Im sure Im missing something so obvious, but cant seem to troubleshoot it. I am getting a type mismatch on the following 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 is the line throwing up the error
sFormName = "frm: Ledger Detail"
DoCmd.OpenForm sFormName, acViewNormal, , sWhere, , acDialog
Can someone point out what I'm doing wrong?
Very much appreciated!!