Insert not working ??
-
Dear All, Am using Access database 2007. i have a table called "Entities" and a form for this table. on the form i placed a button, so that when clicked it inserts a record (2 string fields) in the "entities" table which are Entity_Name and Entity_Location. am using: DoCmd.RunSQL "insert into entities (Entity_Name,Entity_Location) values (v,c);" . where v and c are two strings with predefined values. Problem: When i switch to form view and click on the button, a window pop up promoting me to provide v and c ?? Its not taking the values i provided inside the button_click() . any help ??
0 will always beats the 1.
-
Dear All, Am using Access database 2007. i have a table called "Entities" and a form for this table. on the form i placed a button, so that when clicked it inserts a record (2 string fields) in the "entities" table which are Entity_Name and Entity_Location. am using: DoCmd.RunSQL "insert into entities (Entity_Name,Entity_Location) values (v,c);" . where v and c are two strings with predefined values. Problem: When i switch to form view and click on the button, a window pop up promoting me to provide v and c ?? Its not taking the values i provided inside the button_click() . any help ??
0 will always beats the 1.
You made v and c parameter of the query.
DoCmd.RunSQL "insert into entities (Entity_Name,Entity_Location) values ('" & v & "', '" & c & "');"
Cheers To other readers : Yes I know about SQL injection attacks
If you can read this, you don't have Papyrus installed