Input Parameter Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a form (frm_Filter) that allows the user to select the values
to as many parameters as they wish (City, Item, Priority level, customer
Name, delivery date, etc...).
If the user presses a button (cmd_Start), then a filter string is created
(like the WHERE condition in an SQL query) that can be used to filter a
report or a form or a query or whatever.
If the user presses a button (cmd_CloseForm), the form is closed and no such
string is formed.

When the user selects a report from the Main Menu (frm_Main), I would like
(frm_Filter) to open up, allow the user to create a filter. Then when the
button is pressed (cmd_Start), the filter form (frm_Filter) closes and passes
the string to the Main Menu form (the calling form). Now the report can be
opened with the correct filter.
Any suggestions?
I knew how to do this a year ago......but have forgotten since.
 
On Tue, 16 Aug 2005 09:28:06 -0700, "Hafeez Esmail" <Hafeez
When the user selects a report from the Main Menu (frm_Main), I would like
(frm_Filter) to open up, allow the user to create a filter. Then when the
button is pressed (cmd_Start), the filter form (frm_Filter) closes and passes
the string to the Main Menu form (the calling form). Now the report can be
opened with the correct filter.
Any suggestions?

One handy way to do this is to open frm_Filter in each Report's Open
event. Open the Form with WindowMode:=acDialog in the OpenForm method,
and put a command button "Go" or "Print" on the form; its click event
should simply set the form's Visible property to False.

A Dialog form suspends code execution until it is closed - OR HIDDEN.
By hiding the form, you let the Report's Open event continue; the
report runs, and references the constructed query.

Close the form in the Report's Close event.

John W. Vinson[MVP]
 
Back
Top