View Single Post
  #8 (permalink)  
Old December 4th, 2003, 04:19 PM
John K. King John K. King is offline
Authorized User
 
Join Date: Jun 2003
Location: Sheridan, OR, USA.
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I may have been too long away from Access (I work with SQL Server). It looks like Date() is a legitimate function in a SQL statement from within Access.

The best way to answer your question is to

1) add the line

Debug.Print strSQL

to the procedure after the point where you set the variable strSQL

2) modify the procedure to set the variable strSQL to the original string, step through it, and see the SQL statement printed in the immediate window.

3) modify the procedure to set the variable strSQL to the string where Date() failed, step through it, and see the SQL statement printed in the immediate window.

You may be able to identify the reason for the failure when comparing the two strings. If not, just post the results and I'll see if I can see the reason.

To be honest, I don't know why it didn't work when you first added the double-quotes. I would have expected

"VALUES (Date(), '" & strSaveAs & "');"

to work fine. It may have been that the missing space (separating the closing parenthesis and the 'VALUES' keyword) was the problem then.

JK
Reply With Quote