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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Building a report from search results

Status
Not open for further replies.

joriehl

MIS
Jan 7, 2002
1
US
Hello,

I'm new to this stuff but seem to be doing OK with the learning curve. However, this one has me stumped. I want the DB user to use a "search box" and to generate a report automaticly from the results.

Example: A table lists computer assets, the asset location and the primary user. The user types in "113B" and a report is generated showing all the assets in that room and the primary users.

I've tried several ways and have met with little success.

Please help!
 
Here's a quick and dirty example:

*Create a report (you can probably use the report wizard) to display all the Assets/Primary Users. Make sure you include the AssetLocation field in the datasource for the report (you can remove it from the report so it won't display if you want).

*Create a form with a combobox that lists all the asset locations (let's say you call this cbo_AssetLocations). Include a button to print or preview the report you created. You can use the button wizard to create the code to open the form.

Modify the code for the button that was created by the wizard to include a Where clause:

For example:

(The following code is one 1 line):

DoCmd.OpenReport "AssetReport", acPreview, , "[AssetLocation]=" & cbo_AssetLocations



Obviously you'll want to include error checking, etc., but this should give you the general idea.
 
first thing you do is create a query that takes a field (e.g. 113B).
then make a report based upon the query

whenever the user previews the report, it will ask for the field, then... when the user clicks the button the report will be generated...

email me if anything: larosema@acenturewilm.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top