Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a filtered report

Status
Not open for further replies.

bgroce

MIS
Jan 27, 2004
15
US
I have a report that basically shows all the data in a very large database. This data is sorted by a job number. I was wondering if there is any way to print a report with a specific job number and to do so from the form in which the user has entered the information. What I am trying to do is generate a filtered report upon entering of data in a form and be able to print this report by pressing a button, kind of like a submit button. Anyone have any ideas?
 
Use the wizard to create a button to open the report. Afterwards find the on click event of the button and enter it.

There you'll find something like this:

[tt]docmd.openreport "rptName", acVievPreview[/tt]

Alter that to include a where condition:

[tt]docmd.openreport "rptName", acVievPreview,,"FieldName =" & Me!txtControl.Value[/tt]

Field name is the criteria field/primary key on which to filter. txtControl represents the textbox on the form containing the value to use. Substitute those with your field/control names.

Roy-Vidar
 
When you say use the wizard to create a button to open the report, which wizard do you mean?
 
The create button wizard. The wizard popping up when creating a button on a form...

Roy-Vidar
 
I am sorry to sound so dumb, but I can't find the button wizard anywhere. Can you tell me where it is? I know how to manually insert a button onto a form, but I can't find the wizard. Thanks
 
Ensure that button number two on the toolbox is pressed (wand/control wizard), then when creating some controls, buttons, combo, list, option group... the wizard will pop up.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top