Question : Why am I getting a data type mismatch error?

When this code runs I get an error that says "data type mismatch in criteria expression".  It's having a problem with this line:

strSQL = "SELECT * FROM tbl_APPTs WHERE CLIENT_ID = '" & Me.CLIENT_ID & "' AND APPT_ID = '" & Me.APPT_ID & "'"

but I'm not sure what the problem is.  Can someone help?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Private Sub cmdCancel_Click()
    Dim message As String
    Dim rstAppt As DAO.Recordset
    Dim strSQL As String
    strSQL = "SELECT * FROM tbl_APPTs WHERE CLIENT_ID = '" & Me.CLIENT_ID & "' AND APPT_ID = '" & Me.APPT_ID & "'"

    Set rstAppt = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
    message = MsgBox("Do you want to delete this appointment?", vbYesNoCancel)
       If message = vbYes Then
          'Delete this appointment
          DoCmd.Close , "", acSaveNo
          rstAppt.Delete
       End If
       If message = vbNo Then
          Me.Dirty = False
       End If
End Sub

Answer : Why am I getting a data type mismatch error?

Are CLIENT_ID and APPT_ID Numeric values? If so, they don't need to be enclosed in quotes:

strSQL = "SELECT * FROM tbl_APPTs WHERE CLIENT_ID = " & Me.CLIENT_ID & " AND APPT_ID = " & Me.APPT_ID
Random Solutions  
  •  I am trying to load windows xp on a hp g71-340us laptop.  The factory installed OS is windows 7 Home Premium.  When the set-up disk is loading i get a Stop 0x0000007b BSOD.
  •  how to install certificate in SBS 2008
  •  what is the best way to remove opachki.ru trojan?
  •  How can I record two DV (firewire) inputs simultanously to a PC or Mac?
  •  system idle 99% however the cpu usage runs at between 25 & 45 %
  •  Can I add multi-millions of records to SQL database while replication is on? Will it work?
  •  Why Not able to read excel file in the Web application running on Windows7/Office2010?
  •  Using a query to filter a subreport?
  •  Quickr..How do I edit the tabs on the home page of my place? I want to add a tab
  •  Replace sring on the first line and then replace ALL the following string(2 to eof)
  •  
    programming4us programming4us