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

Report based on ID

Status
Not open for further replies.

reta

Technical User
Dec 23, 2004
51
AU
Hi i would like to create a report (invoice) based on the ID of the user. When they press the report button an invoice will be created based on that ID and display all the items borrowed against that ID number.
thanks
Reta
 
I'm assuming then that you have a table with the user's ID stored in it?

Without any details about your table structure or field names, in the OnClick event of the button you'd put something like:

Docmd.OpenReport "ReportName", acPrintPreview, , "[UserID] = '" & GetUserID() & "'"

substitute your report name for "ReportName"
sub your UserID field name for [UserID]
I'm not sure how you are getting the userID. but however you get it, sub that in for GetUserID().

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
i created a qury based on the two tables. One of the tables have the userID and the other one has the equipment ID. In the query there is no pk because a user can borrow more than one product at anyone time.
In the query under the userID i have a statement [Forms]![Borror]![cboSelected] in the cboSelected is the ID of the user and all of the other fields are included in the query. When i open up the query it shows the correct information but when i press the preview but it prints the report twice with different serial numbers.
i hope that makes sense.
thanks
 
I put in the code like you said. However, for example if a user has borrowed more than one item their ID will appear twice in the onloans table and therefore print the information twice (ID and serial numbers). i only want the ID to be printed once at the top of the report and if there is more than one item borrowed the serial numbers will be displayed.
 
Dont worry about this anymore i used a subform
thanks for your help
Reta
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top