Reread my suggestion. You aren't putting quotes around the variables: you're
passing the name of the variable the way you're doing it.
You can use
strsql = "DELETE FROM [Employee/Jobcodes] WHERE [empnum] = " & Chr$(34) &
sempnum & Chr$(34) & " And [JobCode] = " & Chr$(34) & sJobCode & Chr$(34)
or you can use
strsql = "DELETE FROM [Employee/Jobcodes] WHERE [empnum] = """ & sempnum &
""" And [JobCode] = """ & sJobCode & """"
(that's 3 double quotes before and after sempnum, 3 double quotes before
sJobCode and 4 after)
or you can use
strsql = "DELETE FROM [Employee/Jobcodes] WHERE [empnum] = '" & sempnum &
"' And [JobCode] = '" & sJobCode & "'"
Exagerated for clarity, this last one is
strsql = "DELETE FROM [Employee/Jobcodes] WHERE [empnum] = ' " & sempnum &
" ' And [JobCode] = ' " & sJobCode & " ' "
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Chuckles" <tm*****@new.rr.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Thanks for the reply
They are both text so I tried this
strsql = "DELETE FROM [Employee/Jobcodes] WHERE [empnum] = " &
"sempnum" And " [JobCode] = " & "sJobCode"
I also set a breakpoint. empnum shows the correct string from sempnum
but jobcode shows jobcode = "" maybe the breakpoint didn't make it all
the way down the string? Still getting the type mismatch