Different 'versions' of one form?

  • Thread starter Thread starter Names
  • Start date Start date
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.
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top