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 2008

Tip: Looking for answers? Try searching our database.

Different 'versions' of one form?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Names - 27 May 2008 09:46 GMT
Version of Access used: 2003

Hi

Is it possible to make a form look different through opening it using
different ways?

For example could one choose to make a particular label visible only when
the form is opened through clicking a certain button? Or perhaps have the
form header appear when another button is used instead?
Would this require the use of code?

Thanks!
Warmest regards.
Arvin Meyer [MVP] - 27 May 2008 12:55 GMT
Yes, you can do it, and yes it would require the use of code. If you can't
or don't want to use code, the only way that I can see to accomplish your
goal is to have multiple forms.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> Version of Access used: 2003
>
[quoted text clipped - 10 lines]
> Thanks!
> Warmest regards.
fredg - 27 May 2008 17:26 GMT
> Version of Access used: 2003
>
[quoted text clipped - 10 lines]
> Thanks!
> Warmest regards.

You do need to use code.

Code a command button's click event on FormA:
DoCmd.OpenForm "FormB" , , , , , , "Hello"

Code a  2nd button:
DoCmd.OpenForm "FormB", , , , , , "Goodbye"

Code a 3rd button:
DoCmd,OpenForm 'FormB", , , , , , "Welcome"

Code a 4th button:
DoCmd,OpenForm 'FormB", , , , , , "Default"

Code FormB's Load event:
If Not IsNull(Me.OpenArgs) Then
    If Me.OpenArgs = "Hello" Then
        LabelName1.Visible = True
        LabelName2.Visible = False
    ElseIf Me.OpenArgs = "Goodbye" then
        LabelName2.Visible = True
        LabelName1.Visible = False
    ElseIf Me.OpenArgs = "Welcome" then
        LabelName1.Visible = False
        LabelName2.Visible = False
    Else
        LabelName.Visible = True
        LabelName.Visible = True
    End If
End If
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Names - 28 May 2008 02:22 GMT
Yay.. Thanks very much Arvin and fredg!
Warmest Regards.
 
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



©2008 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.