Replace "FormName" in DoCmd.OpenForm with Value

mlr

Registered User.
Local time
Today, 05:33
Joined
Feb 26, 2011
Messages
16
Is it possible to replace the FormName in the DoCmd.OpenForm with a Form Value?

I have a table with form names & codes, I’ve made a Main [Continuous Form] Menu listing Sub Menus…

x1 | MFN | x2
------------------------
1 | FA001| Company
2 | FA002| Employees

With Add & Modify Buttons


If the focus is on 2 & the User click the Modify Button, how do get the DoCmd.OpenForm "FA002" to insert the corresponding [MFN] data (FA002) into the statement.


I’ve tried - DoCmd.OpenForm "Me![MFN]", acNormal, "", "", , acNormal

Thank You
Mark

Access 2007\2010
 
DoCmd.OpenForm Me![MFN], acNormal, , , , acNormal

You probably don't need that last acNormal either because that is the default. So this would work:

DoCmd.OpenForm Me![MFN], acNormal
 
Thanks Bob, feeling quite stupid now for leaving the quotes in.
 

Users who are viewing this thread

Back
Top Bottom