A
Ayo
Private Sub cmdVendor_Reviewer_Report_Click()
Dim dbs As Database: Dim qdf As QueryDef: Dim strSQL As String
Set dbs = db1
strSQL = "SELECT * FROM [Invoice Tracker] WHERE ((([Invoice
Tracker].Vendor)=" & _
"Forms![Select Vendor and Reviewer]![cmbVendorName]" & ")AND ((" & _
"([Invoice Tracker].Market Reviewer)=" & "Forms![Select Vendor and
Reviewer]![cmbMarketReviewer]" & "));"
Set qdf = dbs.QueryDef("SecondQuarter", strSQL)
executeQueryDef qdf
End Sub
I need help with the above code. I am try to build a query using the above
code and build a report based on the query but, I am getting a Type mismatch
error message on " Set dbs = db1". And I don't know what is wrong.
Can any one please help?
Thanks
Ayo
Dim dbs As Database: Dim qdf As QueryDef: Dim strSQL As String
Set dbs = db1
strSQL = "SELECT * FROM [Invoice Tracker] WHERE ((([Invoice
Tracker].Vendor)=" & _
"Forms![Select Vendor and Reviewer]![cmbVendorName]" & ")AND ((" & _
"([Invoice Tracker].Market Reviewer)=" & "Forms![Select Vendor and
Reviewer]![cmbMarketReviewer]" & "));"
Set qdf = dbs.QueryDef("SecondQuarter", strSQL)
executeQueryDef qdf
End Sub
I need help with the above code. I am try to build a query using the above
code and build a report based on the query but, I am getting a Type mismatch
error message on " Set dbs = db1". And I don't know what is wrong.
Can any one please help?
Thanks
Ayo