Good afternoon,
I have a query supplying data to a report, however I want to add a where clause into this. I have a small form set up with three buttons, I have the value of the button stored in a variable, I pass that variable into the docmd openreport statment, however the where clause does not seem to be working here is docmd statment:
The query behind the report is simply
I have a query supplying data to a report, however I want to add a where clause into this. I have a small form set up with three buttons, I have the value of the button stored in a variable, I pass that variable into the docmd openreport statment, however the where clause does not seem to be working here is docmd statment:
Code:
Private Sub cmdTruss_Click()
On Error GoTo Err_cmdTruss_Click
Dim strType As String
Dim stDocName As String
Dim strWhereCondition As String
strWhereCondition = "[Type] ='Truss'"
stDocName = "JobTime"
DoCmd.OpenReport stDocName, acPreview, , strWhereCondition, acWindowNormal
Code:
SELECT * FROM tmpJobTime