using an option group and a list box to preview a report -
02-26-2004
, 05:03 AM
Hi, I am trying to bring up a report called "Job Details" when a
person clicks on the first option from an option group (called
ReportToPrint) and selects a job name from a list box (called
selectJobName) and clicks on a the button called "preview" on the form
called "Job Inquiries". Then the report should display the details
fot the particular job they have selected from the list box. Here
is the code for this button but the report is not displaying anything.
Any ideas??
Private Sub preview_Click()
On Error GoTo Err_preview_Click
Dim strWhereCategory As String
strWhereCategory = "JobName = Forms![Job Inquiries]!selectJobName"
Select Case Me!ReportToPrint
Case 1
DoCmd.OpenReport "Job Details", acPreview, , strWhereCategory
Case 2
DoCmd.OpenReport "Job Details", acPreview
End Select
Exit_preview_Click:
Exit Sub
Err_preview_Click:
MsgBox Err.Description
Resume Exit_preview_Click
End Sub |