Generate Report based on Drop-down Selection (1 Viewer)

majid.pervaiz

Registered User.
Local time
Today, 11:35
Joined
Oct 15, 2012
Messages
110
Dear Experts,

Can someone please guide me how to generate the report based on the selection from the drop-down. For illustration purpose, I have added the sample database:

So I have data that lists down the process names for multiple countries, and I want to generate a report based on the input / selection of the country.

For example, for UK if I have 10 processes, France 20 etc. I will select UK from the drop-down and it will generate the report for UK only.

appreciate your guidance.
 

Attachments

  • Test.accdb
    576 KB · Views: 68

plog

Banishment Pending
Local time
Today, 03:35
Joined
May 11, 2011
Messages
11,646
Step 1. Throw away your query and base your report just on the table.

Step 2: On the Onclick Event of your form's button add this code:

DoCmd.OpenReport "ReportTest", acViewPreview, , "[Country]='" & Me.Combo1 & "'"
 

majid.pervaiz

Registered User.
Local time
Today, 11:35
Joined
Oct 15, 2012
Messages
110
Step 1. Throw away your query and base your report just on the table.

Step 2: On the Onclick Event of your form's button add this code:

DoCmd.OpenReport "ReportTest", acViewPreview, , "[Country]='" & Me.Combo1 & "'"
thank you so much it worked, I really appreciate your support
 

majid.pervaiz

Registered User.
Local time
Today, 11:35
Joined
Oct 15, 2012
Messages
110
there is one more condition I need to set, due for review is another column which is showing "True" or "False"

In this command where I can this condition
DoCmd.OpenReport "ReportTest", acViewPreview, , "[Country]='" & Me.Combo1 & "'"
 

MarkK

bit cruncher
Local time
Today, 01:35
Joined
Mar 17, 2004
Messages
8,181
I looked at the database you posted. There is no DueForReview field showing "True" or "False." If there was such a boolean field, and you wanted to select rows where that value is "True," then amend the code to...
Code:
DoCmd.OpenReport "ReportTest", acViewPreview, , "[Country]='" & Me.Combo1 & "' AND DueForReview"
 

MarkK

bit cruncher
Local time
Today, 01:35
Joined
Mar 17, 2004
Messages
8,181
You could also do something more like this, in which the selection is done in the UI before running the report. This gives the user more immediate visibility on what is and what isn't due...
 

Attachments

  • Test1.accdb
    424 KB · Views: 74

Users who are viewing this thread

Top Bottom