ng************@gmail.com wrote:
>I have 2 Forms (Form A with a button Button_A and Form B with a button
Button_B)
When the user click on Button_A or Button_B, it will open the same Form
C with some slightly different controls (ex: Buttons and Textbox)
What is the code to allow dynamic formatting of Form C based on whether
the user click on Button_A or Button_B (coming from Form A or Form B)
Use the OpenForm method's OpenArgs argument to tell form C
who opened it:
DoCmd.OpenForm "FormC", OpenArgs:="A"
Then form C can use its Open event to make control visible
or invisible, set their Top and/or Left property, etc.
Select Case Me.OpenArgs
Case "A"
Me.thistextbox. Visible = True
Me.thattextbox. Visible = False
Case "B"
Me.thistextbox. Visible = False
Me.thattextbox. Visible = True
Case Else
'form was opened from someone else
End Select
--
Marsh