Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple DELETE doesn't work? 1

Status
Not open for further replies.

Asspin

Technical User
Jan 17, 2005
155
0
0
US
What the heck am I doing wrong here?
strAlias is a global variable set on load.
I am getting "Run-time error '3464': Data type mismatch in criteria expression."

Code:
DoCmd.RunSQL "DELETE * FROM tData WHERE sName = '" & strUserName & "' AND iRow = '" & lstStart.ListIndex + 1 & "';"

Dan
 
I don't know why you mention strAlias ....
Anyway, if iRow is defined as numeric in tData:
Code:
DoCmd.RunSQL "DELETE * FROM tData WHERE sName='" & strUserName & "' AND iRow=" & (lstStart.ListIndex + 1)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Sorry, I had jsut renamed that variable! ;)

That was the fix though. Thanks as always PHV!

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top