By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,536 Members | 1,800 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,536 IT Pros & Developers. It's quick & easy.

Filter report by user input

P: 67
I have a report that I'd like to filter based on the user's input. The user would select the month and year that they would like to see data from, and the report would return that data along with the selected month and year in the report header, perhaps in an unbound textbox. How would I go about getting the user input and applying the filter to the OpenReport method?

Thanks!

CB55
Apr 15 '08 #1
Share this Question
Share on Google+
4 Replies


n8kindt
100+
P: 221
I have a report that I'd like to filter based on the user's input. The user would select the month and year that they would like to see data from, and the report would return that data along with the selected month and year in the report header, perhaps in an unbound textbox. How would I go about getting the user input and applying the filter to the OpenReport method?

Thanks!

CB55
i just answered a very similar post last week. CLICKY

if you have problems figuring out how to apply this to the OpenReport method, let me know
Apr 15 '08 #2

P: 67
i just answered a very similar post last week. CLICKY

if you have problems figuring out how to apply this to the OpenReport method, let me know
Ok, that works, but now I have another issue. I have 3 subreports, each of which feeds from a different query. The user now needs to input the month and year three times - once for each subreport. How could I prompt the user only once and copy that response to each query?

Thanks!
Apr 16 '08 #3

P: 67
Ok, that works, but now I have another issue. I have 3 subreports, each of which feeds from a different query. The user now needs to input the month and year three times - once for each subreport. How could I prompt the user only once and copy that response to each query?

Thanks!
Does anyone have any ideas on how to solve this one?

CB55
Apr 21 '08 #4

n8kindt
100+
P: 221
Does anyone have any ideas on how to solve this one?

CB55
i'm assuming u created a form just as i did. if so, create a button on the form and place this code into the onclick event:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Continue_Click()
  2. DoCmd.OpenReport "rptYourTitle", acNormal
  3. Forms!frmYourTitle.Visible = False
  4. End Sub
this hides the form whenever u click the button. access can still access (lol) the values that were input on the form since it is being hidden--not closed.

of course, if the user tries opening the form again, you want the form to reappear so they can change the values if necessary. so in the OnLoad event paste this in there:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Forms!frmYourTitle.Visible = True
  3. End Sub
hope that helps.

regards,
nate
Apr 22 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.