0

I sence victory been battling the this code for 2 days now.

the code i have generated is

strsql = "delete from cg_security_user_right where  user_id= " & TextBox1.Text & " role_id=" & TextBox2.Text & ""

it comes up with this error

Syntax error (missing operator) in query expression 'user_id= 2 role_id=1'.

how do i get past this please

Thank yo so much

4
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by Phasma
1

try:

strsql = "delete from cg_security_user_right where user_id = '" & TextBox1.Text & "' role_id = '" & TextBox2.Text & "'"
0

im seriously scratching my head i cannot think of the thing it can b any suggestions

0

Right after the line where you create the query, please add the following

MsgBox(strsql)

and post the results for us to see.

0

This is a simple Delete query created in Access 2007. I do not believe you need the extra double quote you had in your original post or the single quotes I saw in another unless your user_id and role_id are strings and not integers.

Dim sql As String = "DELETE * FROM [Copy Of tbl_Inventory]" & _
                        "WHERE ((([Copy Of tbl_Inventory].Item_ID)=181));"
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.