G
Guest
Good morning
I would like to see how to make the VALUES in an SQL INSERT INTO statement accept variables. It's rather messy to keep doing this
docmd.runsql "Insert Into tblTABLE (username, userdiv, requestTS) VALUES (Forms!Formname.username, Forms!Formname.userdiv, Forms!Formname.requestTS)" '<--- wrapped, not a line brea
What I'd like to be able to do (and I know the syntax is wrong) is this
dim user as strin
dim div as strin
dim TS as dat
user = Forms!Formname.usernam
div = Forms!Formname.userdi
TS = Forms!Formname.RequestT
docmd.runsql "Insert Into tblTABLE (username, userdiv, requestTS) VALUES (user, div, TS)" '"X
While it is a bit longer, it's significantly neater code in organized blocks. Can someone please provide me with the correct syntax for the code with the "X" next to it
Thank you very much in advance
Derek
I would like to see how to make the VALUES in an SQL INSERT INTO statement accept variables. It's rather messy to keep doing this
docmd.runsql "Insert Into tblTABLE (username, userdiv, requestTS) VALUES (Forms!Formname.username, Forms!Formname.userdiv, Forms!Formname.requestTS)" '<--- wrapped, not a line brea
What I'd like to be able to do (and I know the syntax is wrong) is this
dim user as strin
dim div as strin
dim TS as dat
user = Forms!Formname.usernam
div = Forms!Formname.userdi
TS = Forms!Formname.RequestT
docmd.runsql "Insert Into tblTABLE (username, userdiv, requestTS) VALUES (user, div, TS)" '"X
While it is a bit longer, it's significantly neater code in organized blocks. Can someone please provide me with the correct syntax for the code with the "X" next to it
Thank you very much in advance
Derek