Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open report with option group

Status
Not open for further replies.

Hoving

Technical User
Apr 8, 2002
21
US
Two questions:

1. I have a report, rptEveryone, based on a query, qryEveryone. One field in the query and on the report is called DoctorName. What would I enter in the Filter property of rptEveryone so the report includes only records where the DoctorName field on the report is not blank (i.e., Is Not Null)?

2. A variation of the first question. How do I filter a
report from an option group?

I have an option group, optSelectReport, on a main form, frmMain. The option group has 3 options. When the user
selects the 3rd option (labeled "Print Report for Doctors only") and hits a command button, cmdPreview, I'd like the report, rptEveryone, to open filtered for records where the DoctorName is not null. Right now the report opens unfiltered, because I don't know how to write what I assume should be a Where statement (like "Where DoctorName Is Not Null).

Here's what I have so far in the code of frmMain:

**************************************
Sub PrintReports(PrintMode As Integer)
On Error GoTo Err_Preview_Click
' This procedure used in Preview_Click and Print_Click
' Sub procedures.

Select Case Me!optSelectReport
Case 3
DoCmd.OpenReport "rptEveryone", PrintMode

End Select

Exit_Preview_Click:
Exit Sub
Err_Preview_Click:
Resume Exit_Preview_Click
End Sub
----------------------------------

Private Sub cmdPreview_Click()
PrintReports acPreview
End Sub
----------------------------------

Private Sub cmdPrint_Click()
PrintReports acNormal
End Sub
**************************************

Thank you for any help.

Hoving
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top