Sounds like you want to know what to put under the Print command button.
Using option groups and this sub should get you there
Private Sub cmdPrint_Click()
Select Case Me!optFirstChoice
Case 1 'Incoming
Select Case Me!optSecondChoice
Case 1 'Open
DoCmd.OpenReport "rptIncomingOpen", acViewPreview
Case 2 'Closed
DoCmd.OpenReport "rptIncomingClosed", acViewPreview
Case 3 'No Requirement
DoCmd.OpenReport "rptIncomingNoRequirement", acViewPreview
End Select
Case 2 'Outgoing
Select Case Me!optSecondChoice
Case 1 'Open
DoCmd.OpenReport "rptOutgoingOpen", acViewPreview
Case 2 'Closed
DoCmd.OpenReport "rptOutgoingClosed", acViewPreview
Case 3 'No Requirement
DoCmd.OpenReport "rptOutgoingNoRequirement", acViewPreview
End Select
Case 3 'TD
Select Case Me!optSecondChoice
Case 1 'Open
DoCmd.OpenReport "rptTDOpen", acViewPreview
Case 2 'Closed
DoCmd.OpenReport "rptTDClosed", acViewPreview
Case 3 'No Requirement
DoCmd.OpenReport "rptTDNoRequirement", acViewPreview
End Select
End Select
End Sub
zat via AccessMonster.com said:
I am dealing with correspondences, so I have three different tables:
CorresIn,
CorresOut, CorresTD (for Technical direction letters). The reports have
different data source; therefore, I have different reports depending upon
what the user selects from the form.
Jeff said:
Do all your reports have the same data source but just different
criteria? Based on your description, it sounds like they might. You
can accomplish all of what you are doing with just one report. Your
report has a Record Source in which you have set your criteria.
Instead of using a specific value in the criteria, you can refer to
your form for the values you need. The syntax for that is:
Forms!YourFormName!YourTextBoxName
Hope that helps!
I'm creating a form that has user options to generate a report. One
text box
has Incoming, outgoing and TD options. The other box has Open, Closed,
No
[quoted text clipped - 3 lines]
user clicks on a button and the rprtInOpen report runs. How would I go
about
coding this?