Macros

  • Thread starter Thread starter John A
  • Start date Start date
J

John A

Is it possible to pass parameters into a macro, similar
to parameters in a query. My goal is to be able to have
the user enter a parameter like " Last Name" then have
the macro open one of many forms for data entry based on
the parameter that is entered by the user.


Thanks
 
Happy New Year, John.

The default view of the Macro programming screen does open
to show a column on the left side in which you can enter
conditional expressions, but there is an icon that will do
that for you.

However, I'd need to know more about your effort to be of
more help. I'm not sure I'd approach something like this
based on a user's data entry.
 
In the Form Name argument for the OpenForm action, you can use an expression
similar to this:
=InputBox("Enter the name of the form to be opened:")

When the macro runs, it'll ask the user for the name of the form to be
opened.

Alternatively, you can have the user enter/select a form name in a control
on another form, and then "read" that name by using this expression as the
Form Name argument:
[Forms]![FormName]![ControlName]
 
Back
Top