473,396 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Syntax error in SQL Delete statement

106 100+
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
3 2828
MMcCarthy
14,534 Expert Mod 8TB
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
tara99
106 100+
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
14,534 Expert Mod 8TB
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

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

Similar topics

1
by: Steve | last post by:
I just spent waaaaaaaaaaaayy too much time trying to track down an error that was incorrectly reported just now, and I would like to see if someone can explain to me why it was reported that way. ...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
4
by: Bob Stearns | last post by:
The statement: merge into nullid.animals_et_in t1 using is3.animals t2 on t1.sire_assoc=t2.assoc and t1.sire_prefix=t2.prefix and t1.sire_regnum=t2.regnum when matched then update set...
4
by: Robert | last post by:
What is the syntax to use in a VBA script to execute a pass-through? Thanx
6
by: Squirrel | last post by:
I have a command button on a subform to delete a record. The only statement in the subroutine is: DoCmd.RunCommand acCmdDeleteRecord The subform's recordsource is "select * from tblVisit order...
0
by: compuglobalhypermeganetz0r | last post by:
I am having trouble getting an adapter to update my access database, it gives the error Syntax error in INSERT INTO statement. for Line 98: Adapter.Update(WineDS, "tblWines") Below is my...
3
by: Neil Zanella | last post by:
Hello, I am trying to execute ADO.NET INSERT statement where one of the fields is coming from a password HTML control. When I access the text with password.Value and print with Response.Write...
9
by: ProgrammerGal | last post by:
I am hoping this is a quick easy question for someone! :) I am trying (struggling) with moving data from Sql Server to a Lotus Notes table. I am using SQL Server 2000, I have a Lotus Notes...
16
by: Chuck | last post by:
Please help me correct the statements in sub "BoundData" The following sub is in a module. Everything runs with no error messages, however,data is not reaching the text box. Data is being...
3
by: cyberlei | last post by:
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where stock_id=19721' at line 1" I have been banging my head...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.