Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2007

Tip: Looking for answers? Try searching our database.

Hide fields/textbox when open based on a criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marco - 17 May 2007 10:18 GMT
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
missinglinq - 17 May 2007 11:23 GMT
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
Maurice - 18 May 2007 19:41 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.