marku24
asked on
SQL Syntax in Access VBA
I am trying to INSERT data from a form into a table in Access using SQL in VBA. I am getting an error telling me "Too Few Parameters - Expected 3".
Here is my statement:
strSQL = "INSERT INTO tblHeadcountRequestReposit ory (LastEditedBy, NH_Region, NH_Function, NH_Office)VALUES(" & frmUser & "," & strReq_Region & "," & strReq_F3 & "," & strReq_OFC & ")"
db.Execute (strSQL)
Here are the values from the immediate window:
INSERT INTO tblHeadcountRequestReposit ory (LastEditedBy, NH_Region, NH_Function, NH_Office)VALUES(unganm,Am ericas,URT ,Burlingto n)
Is my SQL statement written incorrectly?
Thanks
Here is my statement:
strSQL = "INSERT INTO tblHeadcountRequestReposit
db.Execute (strSQL)
Here are the values from the immediate window:
INSERT INTO tblHeadcountRequestReposit
Is my SQL statement written incorrectly?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It gets more confusing when you have to embed double quotes. Glad the single quotes will work for you.
ASKER