Results 1 to 2 of 2
2003-03-20, 19:41 #1
- Join Date
- Jan 2001
- Virginia, USA
- Thanked 1 Time in 1 Post
Finding record on report from form (2000)
We're using a report as a receipt to give to people who purchase items at a fund-raiser auction.The report groups on "Bidder Number" and displays the bidder's name, address, phone #...etc. It also displays the items he purchased and what he paid for them.
What I need next is a quick and easy way for the user (cashier) to pull up just the record she wants. We could, of course, just scroll through all the reports till we find the one we want, but with maybe 200 bidders that could be time-consuming. I've thought about using a form with a record selector combo box, and I've got that. We've thought about using a command button that will launch the correct report (receipt), but we haven't figured out how to make it work. We're quickly running out of time. Anybody got a quick 'n dirty way to do this?
2003-03-20, 19:48 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
Re: Finding record on report from form (2000)
You'll need to have an identifier for the receipt. A single field primary key like ReceiptID is ideal. You would have to retrieve this identifier from the combo box.
The code for the command button would be something like
Private Sub cmdOpenReport_Click()
DoCmd.OpenReport "rptReceipt", acViewPreview, , "ReceiptID=" & Me.cboSelectReceipt
This assumes that ReceiptID is in the bound column of the combo box cboSelectReceipt, that ReceiptID is numeric and that the report to be opened is named rptReceipt.
If you have a text primary key, you must enclose the value in quotes:
... "ReceiptID=" & Chr(34) & Me.cboSelectReceipt & Chr(34)