Create Report based on combo box selection

jlocke

Registered User.
Local time
Today, 11:57
Joined
Jul 23, 2002
Messages
31
Ok here is my problem, i have a report selection form which help generate report based on all types of criteria, the one problem i have is when i i don't fill in the Agent box(see snapshot)(left empty) i want all agents on my report. here is the sql code i have. I have tried various Iif statement combos

((tblData.[Beazley Agent])=IIf([Forms]![frmReportDateRange]![cboAgent] Is Not Null,[Forms]![frmReportDateRange]![cboAgent])));
 

Attachments

Last edited:
If you are opening your report from a form how about something like this:

DoCmd.OpenReport "MyReport", acPreview, , IIf(Nz(Me.cboAgent) = "", "", "[Beazley Agent] = '" & Me.cboAgent & "' ")
 
Thank you

:) Richo thank you works perfect! I've tried somthing like your code but the Nz i beleive is what i needed.
 

Users who are viewing this thread

Back
Top Bottom