Send query value in macro

S

samuel

Using access 2003.

I have a query with a criteria [Which facility?] at run time, the user can
type in the value they want.

Is it possible to supply the value in a macro, so the query could execute
without user input. I understand I could build 3 different queries with the
value hard-coded, but I'm thinking the macro would be a bit easier.
 
S

Steve Schapel

Samuel,

No a macro is not applicable in this situation.

It is not clear what you mean by "the query could execute without user
input". If the query requires a criterion, it has to be supplied from
*somewhere*. Where is it going to come from, if the user doesn't supply or
indicate it?

However, if there was a textbox (or combobox or other suitable control) on a
form, where the user could enter the criterion, then the [Which facility?]
in the query could be replaced by a reference to the textbox, using syntax
such as:
[Forms]![NameOfForm]![NameOfControl]
 

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