By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 2,763 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Syntax error in SQL Delete statement

100+
P: 106
strSQL4 = "DELETE * FROM ExecutiveResponsibilitySecurity WHERE [ExecutiveResponsibility]= '" & Me.ExeResponsibility & "' and [NetworkID] = ' " & Me.UserID & "';"

DoCmd.RunSQL strSQL4

I am trying to delete from a table.


ExecutiveResponsibility and NetworkID are fields in the table ExecutiveResponsibilitySecurity

Me.ExeResponsibility and Me.UserID is the name of my combo box and the list box which holds the items thati want to delete.

can any one tell me what is wrong in this statement
thanks
Dec 21 '06 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
strSQL4 = "DELETE * FROM ExecutiveResponsibilitySecurity
WHERE [ExecutiveResponsibility]= '" & Me.ExeResponsibility & "'
and [NetworkID] =" & Me.UserID & ";"

DoCmd.RunSQL strSQL4
[/code]

Assuming NetworkID is a number

Mary
Dec 21 '06 #2

100+
P: 106
strSQL4 = "DELETE * FROM ExecutiveResponsibilitySecurity
WHERE [ExecutiveResponsibility]= '" & Me.ExeResponsibility & "'
and [NetworkID] =" & Me.UserID & ";"

DoCmd.RunSQL strSQL4
[/code]

Assuming NetworkID is a number

Mary
No Mary it is string, but don't worry it is solved for the moment.
It was just the matter or deleting Me and using the variable that i had those two fields stored in.

Thank you so much for prompt reply
Dec 21 '06 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
No Mary it is string, but don't worry it is solved for the moment.
It was just the matter or deleting Me and using the variable that i had those two fields stored in.

Thank you so much for prompt reply
No problem Tara.

I'm glad you got it sorted. Glad to see you making an effort to answer other posts as well. We'll make an expert out of you yet.

Merry Christmas


Mary
Dec 21 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.