Macros

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
 
K

Ken Smith

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.
 
K

Ken Snell

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]
 

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

Top