Feb 10, 2008 #1 fordtran Programmer Jun 15, 2005 101 ZA I have a syntax error in this query, but cannot find it. Can somebody help ? S$ = "INSERT INTO comments (comment, date) VALUES (" & Chr(39) & txtComment.Text & Chr(39) & ", #" & Today & "# )" Thanks fordtran
I have a syntax error in this query, but cannot find it. Can somebody help ? S$ = "INSERT INTO comments (comment, date) VALUES (" & Chr(39) & txtComment.Text & Chr(39) & ", #" & Today & "# )" Thanks fordtran
Feb 10, 2008 1 #2 PHV MIS Nov 8, 2002 53,708 FR Code: S$ = "INSERT INTO comments (comment, [date]) VALUES ('" & Replace(txtComment.Text, "'", "''") & "', #" & Today & "# )" BTW, what is Today ? You meant Date() ? Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
Code: S$ = "INSERT INTO comments (comment, [date]) VALUES ('" & Replace(txtComment.Text, "'", "''") & "', #" & Today & "# )" BTW, what is Today ? You meant Date() ? Hope This Helps, PH. FAQ219-2884 FAQ181-2886
Feb 10, 2008 Thread starter #3 fordtran Programmer Jun 15, 2005 101 ZA Thanks PHV I am not sure of your recommended syntax Is it ... values ( " ' " & txtcomment.text & " ' , #" & date() & "#)" fordtran Upvote 0 Downvote
Thanks PHV I am not sure of your recommended syntax Is it ... values ( " ' " & txtcomment.text & " ' , #" & date() & "#)" fordtran
Feb 10, 2008 #4 PHV MIS Nov 8, 2002 53,708 FR In VBA: Code: S$ = "INSERT INTO comments (comment,[date]) VALUES ('" & Replace(txtComment.Text, "'", "''") & "',#" & Format(Date, "yyyy-mm-dd") & "#)" Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
In VBA: Code: S$ = "INSERT INTO comments (comment,[date]) VALUES ('" & Replace(txtComment.Text, "'", "''") & "',#" & Format(Date, "yyyy-mm-dd") & "#)" Hope This Helps, PH. FAQ219-2884 FAQ181-2886