Running Reports from User Options

  • Thread starter zat via AccessMonster.com
  • Start date
Z

zat via AccessMonster.com

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
Requirement, and All. I developed reports for whatever option the user
chooses. Depending upon which options the user chooses determines what
report is generated. So for instance if a user chooses Incoming and Open the
user clicks on a button and the rprtInOpen report runs. How would I go about
coding this?
 
J

Jeff L

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!
 
Z

zat via AccessMonster.com

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?
 
G

Geary

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top