Good Day.
I have search the forums but have not found an answer to my problem (or at least didn't recognize the answer)...
I would like to open a report using a cmdButton on a forum. The report is based on a query. I would like to filter the results of the query based on a field in the query, that I acquire from a txtBox in the form.
My code:
I recieve and error (missing operator).
I am not sure if my syntax is incorrect ..... do I have to set any properties in the report???? I ran into a similar problem when I was trying to open a form and worked around it by typing in the Where line with the actual name of the workunit "WorkUnit = 'MainStreet'"
All help is appreciated.
DJ
I have search the forums but have not found an answer to my problem (or at least didn't recognize the answer)...
I would like to open a report using a cmdButton on a forum. The report is based on a query. I would like to filter the results of the query based on a field in the query, that I acquire from a txtBox in the form.
My code:
Code:
Private Sub cmdPrintBrief_Click()
Dim sWorkUnit As String
Dim sReportName As String
sReportName = "rptPriorities"
sWorkUnit = Me.tbxWorkUnit
DoCmd.OpenReport sReportName, acViewPreview, , "WorkUnit=" & sWorkUnit
End Sub
I recieve and error (missing operator).
I am not sure if my syntax is incorrect ..... do I have to set any properties in the report???? I ran into a similar problem when I was trying to open a form and worked around it by typing in the Where line with the actual name of the workunit "WorkUnit = 'MainStreet'"
All help is appreciated.
DJ