Open Generic Report with Various Criteria

todAnthony

Wait... What?
Local time
Today, 15:41
Joined
May 25, 2011
Messages
26
As of this link: btabdevelopment.com/ts/samples . I have gotten and learned the "Open Generic Report with Various Criteria (simple sample)" database lesson.

My question is: If this code (that does work properly):

DoCmd.OpenReport "rptNotCompleted", acViewPreview, , "[surveyStatus]=" & Me.cboStatus

opens the generic report according to the selected surveyStatus, how would I go about doing 2 combo boxes to select 2 options to generate the report. With the single option of surveyStatus I get ALL projects. I would like to report the status of xProject. I just do not know how to add to this VBA to accomplish. I have the combo boxes in the form already. The above VBA is on the On Click event of the cmd button.
 
Presuming both fields are numeric:

DoCmd.OpenReport "rptNotCompleted", acViewPreview, , "[surveyStatus]=" & Me.cboStatus & " AND OtherField = " & Me.OtherCombo
 
oic. AND is what I am missing. I will try now

TY
 
Bingo. Specifically it is:

DoCmd.OpenReport "rptNotCompleted", acViewPreview, , "[surveyStatus]=" & Me.cboStatus2 & " AND [projectName] = " & Me.cboProject

TYVM pbaldy. I am learning alot for you guys. I have only ever done the most basic stuff with Access but I am trying to get more advanced and half decent with this. Thanks again.
 

Users who are viewing this thread

Back
Top Bottom