Hi,
I’ve a requirement whereby multiple users run a report based on their areas interests. For this, I created a form so users can enter a start/end date, and select a value from a dropdown and click run query etc. What I’m trying to accomplish is the following:
#1. If a user selects start date, end date, and a value from a dropdown and clicks ‘Run Query’ button, then the report should limit the result to date intervals and value selected from the dropdowns.
#2. If a user doesn’t restrict date intervals, and/or doesn’t make any selection from a dropdown and clicks ‘Run Query’ button, then the report should display everything.
I created a query/report and a form for this and I’ve the following in my qbe:
=[Forms]! [MyFormName]! [MyControlName1]
=[Forms]! [MyFormName]! [MyControlName2]
etc.
[Forms]![MyFormName]![txtBeginDate1] And [Forms]![ MyFormName]![txtEndDate1]
[Forms]![MyFormName]![txtBeginDate2] And [Forms]![ MyFormName]![txtEndDate2]
etc.
DoCmd.OpenQuery "MyReportName", acViewPreview
So far, only the first control is working. When I select a value from say MyControlName1 and begin & end date intervals from the other query nothing happens.
Can you please assist?
TIA
OCM
I’ve a requirement whereby multiple users run a report based on their areas interests. For this, I created a form so users can enter a start/end date, and select a value from a dropdown and click run query etc. What I’m trying to accomplish is the following:
#1. If a user selects start date, end date, and a value from a dropdown and clicks ‘Run Query’ button, then the report should limit the result to date intervals and value selected from the dropdowns.
#2. If a user doesn’t restrict date intervals, and/or doesn’t make any selection from a dropdown and clicks ‘Run Query’ button, then the report should display everything.
I created a query/report and a form for this and I’ve the following in my qbe:
=[Forms]! [MyFormName]! [MyControlName1]
=[Forms]! [MyFormName]! [MyControlName2]
etc.
[Forms]![MyFormName]![txtBeginDate1] And [Forms]![ MyFormName]![txtEndDate1]
[Forms]![MyFormName]![txtBeginDate2] And [Forms]![ MyFormName]![txtEndDate2]
etc.
DoCmd.OpenQuery "MyReportName", acViewPreview
So far, only the first control is working. When I select a value from say MyControlName1 and begin & end date intervals from the other query nothing happens.
Can you please assist?
TIA
OCM