Link to home
Start Free TrialLog in
Avatar of TSTechNA
TSTechNA

asked on

SQL insert into statement question (access 2007)

is there a way to include my variable ts with whatever the user types in the parameter box?
thank you

Dim ts As String
ts = Now
DoCmd.RunSQL "INSERT INTO NotesTable([Notes])VALUES ([Enter your note])"
ASKER CERTIFIED SOLUTION
Avatar of orcic
orcic

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rey Obrero (Capricorn1)
just a slight correction

----------------------------------------------------------------v-put a space
DoCmd.RunSQL "INSERT INTO NotesTable([Notes]) VALUES ('" & ts & "')"
Avatar of TSTechNA
TSTechNA

ASKER

awesome, that works but could you explain why it works? i don't really understand the syntax

also is there a way to include ts and my parameter of ([Enter your note]) together? so that they will be 1 record? basically a time/date stamped comment/note is all i am trying to do

thank you
DoCmd.RunSQL "INSERT INTO NotesTable([Notes]) VALUES ('" & ts & " " & now() & "')"