Link to home
Create AccountLog 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
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
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() & "')"