View Full Version : parameters and macros


mrcoop1982
02-06-2006, 02:46 PM
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

Ziggy1
02-07-2006, 07:37 PM
what are you trying to do and what macro action(s) are you planning to use?

mrcoop1982
02-08-2006, 10:34 AM
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.

brucesilvers
02-08-2006, 11:46 AM
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.

Ziggy1
02-09-2006, 10:33 AM
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

mrcoop1982
02-09-2006, 12:16 PM
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!