Hello.
I have a forma that can be open from 2 diferent forms. If the form A is open
from form Z, the form A shows all textbox. If the form A is open from form X,
only 1 textbox is visible.
How can I do this?
Regards,
Marco
You need to use OpenArgs to let Access know what to do!
Behind the button on FormZ
DoCmd.OpenForm "FormA", , , , , , "Show All Textboxes"
Behind button on FormX
Behind button on FormBDoCmd.OpenForm "FormA", , , , , , Me.OpenArgs = "Show
All Textboxes"
Then on FormA
Private Sub Form_Open(Cancel As Integer)
If Me.OpenArgs = "Show All Textboxes" Then
' Do nothing; all textboxes will be shown
ElseIf Me.OpenArgs =Me.OpenArgs = "Show All Textboxes" Then
'Place code here to make the Visible property of all textboxes except
one False
End If
End Sub

Signature
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000
Marco - 17 May 2007 11:49 GMT
Hi.
I forgot to mention that both forms are using the same subform. in that case
should be something like if form Z is actived then ... else if form X is
activated then....
Right?
regards,
Marco
> You need to use OpenArgs to let Access know what to do!
>
[quoted text clipped - 19 lines]
>
> End Sub
Marco - 17 May 2007 12:00 GMT
Hi. I'm trying with this but isn't working:
If [Forms]![3_form_MedicinaCurativa]![ID] <> "" Then
DoCmd.OpenForm "9_form_Visualizacao_Consultas_MedicinaCurativa", , , "id = "
& Me!ID, Me.OpenArgs = "Show All Textboxes"
Else
If [Forms]![11_form_MedicinaTrabalho]![ID] <> "" Then
DoCmd.OpenForm "9_form_Visualizacao_Consultas_MedicinaCurativa", , , "id = "
& Me!ID, Me.OpenArgs = "Don't Show All Textboxes"
End If
End If
> You need to use OpenArgs to let Access know what to do!
>
[quoted text clipped - 19 lines]
>
> End Sub
Marco,
You could also try:
On Onopen from form A
If isloaded(z)
hide this....
else
hide this... (then it has to be the X form)
end if
just an alternative...

Signature
Maurice Ausum
> Hello.
> I have a forma that can be open from 2 diferent forms. If the form A is open
[quoted text clipped - 5 lines]
> Regards,
> Marco