By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,570 Members | 970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,570 IT Pros & Developers. It's quick & easy.

Dynamic formatting on Ms Access Form

P: n/a
Hi everybody,

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)

Thank you for your help.
Antony

Jan 22 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Jan 22 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.