Creating reports with User defined criteria

  • Thread starter Thread starter Sue
  • Start date Start date
S

Sue

Hello

I would like to create a report where, the user will have to select
from a drop down box one of the field names. For example, if the user
selected Last Name from the drop down box, then, an other form should
open up for the user to type in a search criteria, in this case a last
name, and the report should open up with all the last names that
match. Can someone please tell me as to how this can be done. All
information the report would need is all from the same table.

Any help I could get would be appreciated.

Thanks
Sue..
 
In the Open event of the Report, open the form using the acDialog window
mode argument. This will pause the code until you close or hide the form.
Have the controls you desire on the form for the user to make their
selections. Once the selections have been made, you need two buttons on the
form, an Ok and a Cancel. The Ok button will hide the form, the Cancel will
close it. In the report's Open event, check to see if the form is still
open. If it isn't, cancel opening the report. If it is, continue to open the
report. Remember to close form in the report's Close event.

Use the selections on the form as parameters for the query feeding the
report. To do this, refer to the controls on the form in the criteria of the
query.

Example Criteria:
Forms!frmFormForReport!txtMyTextbox
 
Sue said:
Hello

I would like to create a report where, the user will have to select
from a drop down box one of the field names. For example, if the user
selected Last Name from the drop down box, then, an other form should
open up for the user to type in a search criteria, in this case a last
name, and the report should open up with all the last names that
match. Can someone please tell me as to how this can be done. All
information the report would need is all from the same table.

Any help I could get would be appreciated.

Thanks
Sue..

An easy solution would be to copy the report modifying the copies so you
would have one for each field. Then select the report based on the combo
box selection.
 

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

Back
Top