Multiple Criteria on Form to open Report

monkeysee

New Member
Joined
Sep 26, 2017
Messages
3
I have a form with 1 combo box and 2 text boxes all are unbound. My combo box is named combo6 and and the text boxes are text2 and text4.
The combo box houses the EmployeeName; and the 2 text boxes gives a choice for a start date and an end date. My report to be opened: EmpBalSheet. The form is: EmpBalSheetFilter. The Query is QryEmpBalSheet with the fields EmployeeName and VisitDate.
My Event procedure (DoCmd.OpenReport "EmpBalSheet", acViewPreview, , "[VisitDate] Between #" & Me.Text2 & "# And #" & Me.Text4 & "#") opens the report and displays the correct date range that has been chosen. But my problem is how to add the EmployeeName combo box to the procedure. Any help will be greatly appreciated. Thank you in advance!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
If the report opening cannot occur when the combo has no selection (no value in it) and the first column of the combo contains that value, then
"EmployeeName = '" & Me.combo6 & "' And [VisitDate] Between #" & Me.Text2 & "# And #" & Me.Text4 & "#"
 
Last edited:
Upvote 0
If the report opening cannot occur when the combo has no selection (no value in it) and the first column of the combo contains that value, then
"EmployeeName = '" & Me.combo6 & "' And [VisitDate] Between #" & Me.Text2 & "# And #" & Me.Text4 & "#"

Thank you Micron for your help! It works..
  • :wink:




 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,892
Members
449,058
Latest member
Guy Boot

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top