parameters and macros

  • Thread starter Thread starter mrcoop1982
  • Start date Start date
M

mrcoop1982

Guest
I am trying to answer a parameter by using a macro. So I would like to be able to pass a parameter with a macro. Is this possiable, or am I trying to complete something a harder way then it has to be?

If anyone can help I would appreciate it.

Thanks
 
Last edited:
what are you trying to do and what macro action(s) are you planning to use?
 
I am trying to make a form that will allow a user to select a section (let say 1600). Instead of making a new query for every section, is it possiable to create one query, and use a parameter, such as enter section. So when the selection of 1600 is made, I don't want them to see the pop up to ask for a section, but I would like to be able to answer the parameter which would be 1600 without the pop up happening. This would save from having to make so many queries.
 
I'm not sure what you mean by:

I don't want them to see the pop up to ask for a section, but I would like to be able to answer the parameter which would be 1600 without the pop up happening

If the USER is deciding which section to query, then the user is going to have to either type in the section or select it somehow.

The simplest way is to add the parameter to the query design grid, eg: [Enter Section Number] on the criteria line. When the query runs, a dialogue box pops up and prompts the user to type in the section number and hit the OK button.

If you don't like the way that parameter dialogue box looks, you could create a combo box or list box on your form that contains all the available sections. You could run and display the query as the "After Update" event for the combo box, or include a button with a list box that runs and displays the query as an "On Click" event.
 
with the form you can filter the criteria in the query by placing the name of the control in the Criteria section of the query design for the Section field.

Depending on how your form is designed to operate, if you want the selected section to be resricted, then the name of the section control in the query design grid will be:

Forms![Formname]![ControlName]

Add a button to your form that opens the query and the query will filter based on the section number displayed in that control
 
I understand using what you put there. The other question I have is it possiable to have a comand button that says 16100, and when the button is clicked it filters the query for all of the sections that are 16100. So is there a control like Forms![Formname]![ControlName], that would use the name of the control its self for the selection.

Thanks for the help so far!
 

Users who are viewing this thread

Back
Top Bottom