jeran042
Registered User.
- Local time
- Today, 04:56
- Joined
- Jun 26, 2017
- Messages
- 127
I believe I am missing something so obvious. I am trying to open a form with multiple criteria in VBA, here is what I have:
Is there something I need to do to account for when combining an integer and a string in a WHERE clause?
Very much appreciated,
Code:
Private Sub Text2_Click()
Dim iCost_Center As Integer
Dim sCategory As String
Dim sWhere As String
Dim sFormName As String
iCost_Center = Me.txtCOST_CENTER
sCategory = Me.txtTemp_Month_Temp_Per
sWhere = "[COST_CENTER] = " & iCost_Center And "[CATEGORY] = " & "'" & sCategory & "'" 'This line is throwing up a Runtime Error 13
sFormName = "frm: Ledger Detail"
DoCmd.OpenForm sFormName, acViewNormal, , sWhere, , acDialog
End Sub
Is there something I need to do to account for when combining an integer and a string in a WHERE clause?
Very much appreciated,