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!

Access 2000 report button

Status
Not open for further replies.

fingermouse

Technical User
Jan 22, 2004
2
GB
Hi,

I'm in the process of setting up a database for the first time and have run into a brick wall with a report I want to run.

Customers are collecting points, which then get exchanged for vouchers, and I need to print a receipt for each voucher issue with serial numbers etc.

I've got my form set up OK, and I thought I had a report for the receipt, but when I put in my dummy data & print the report it prints out every transaction - I cannot get it to print the report just for that transaction.

I have a feeling that I'm probably going at this from the wrong direction - any help gratefully received!

FM
 
Hi,

Try changing the criteria in the query that the report is based on so that the number of records is limited to what you're after.

Otherwise if you're using vb to open the report add a filter e.g. DoCmd.OpenReport "Report1", , , "ID = " & Me.ID

good luck !
 
Thanks Chris,

I've put in a criteria in the query, so it prompts for the transaction no each time

FM
 
Hi fingermouse instead of prompting the user for the transaction number, you can add a where statement to the code for the the button and use a control on your form as the criteria

Code:
On Error GoTo Err_Command136_Click

    Dim stDocName As String

    stDocName = "rep_tracking_product_breakdown"
    DoCmd.OpenReport stDocName, acPreview, , "product_name = '" & combo_report_product.Value & "'"

Exit_Command136_Click:
    Exit Sub

Err_Command136_Click:
    MsgBox Err.Description
    Resume Exit_Command136_Click

Filmmaker, gentleman and pearls before swine fan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top