If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Run different reports based on field values?
In Access 2000 I have a database using a form for data
entry. I have it set up so that you can press a command button to print a letter (Report) for the record that is currently displayed. However, there are 3 categories of items that each require a differently formatted letter. Thus I have 3 reports for each type. Rather than using 3 separate buttons based on the category to print the correct report (which would have to be manually selected), can I set it up so that with one button it will run the correct report based on the the value in the category field? Ie: If Category = Car, then Report 1 If Category = Truck, then Report 2 I am stumped on how to do this. Thanks! |
#2
|
|||
|
|||
Run different reports based on field values?
Thomas wrote:
In Access 2000 I have a database using a form for data entry. I have it set up so that you can press a command button to print a letter (Report) for the record that is currently displayed. However, there are 3 categories of items that each require a differently formatted letter. Thus I have 3 reports for each type. Rather than using 3 separate buttons based on the category to print the correct report (which would have to be manually selected), can I set it up so that with one button it will run the correct report based on the the value in the category field? Ie: If Category = Car, then Report 1 If Category = Truck, then Report 2 Change the buttons code to include: If Category = "Car" Then strDocName = "Report 1" ElseIf Category = "Truck" Then strDocName = "Report 2" Else strDocName = "Report 3" End If DoCmd.OpenReport strDocName, . . . -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|