Different 'versions' of one form?

N

Names

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.
 
A

Arvin Meyer [MVP]

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.
 
F

fredg

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.

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
 
Top