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

try:

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

no its still coming with the same error :{

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

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

MsgBox(strsql)

and post the results for us to see.

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));"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.