brucemc777
Member
- Local time
- Yesterday, 19:07
- Joined
- Nov 1, 2012
- Messages
- 87
Stick a fork in me, i'm done.
ALL day i have been trying to figure out how to make this work before pestering you folks. The actual SQL statement is much longer, but all of it works fine until i stick that last date field into it. I keep getting a syntax error and i don't know how many more combinations of # and " i can come up with, even though the same combination as i thought i learned works fine in another DATE/TIME field in the middle of same actual string. And before anyone asks (though i seriously doubt it would throw a syntax error) because i have seen a lot of squirrely things with VBA in working with Excel, i verified that the TimeStamp field was Date/TIME (Actually was DATE/TIME EXTENDED at first, but jic i switched it to plain DATE/TIME), and i verified dtNow was type 7...
What am i doing wrong here?
Thank you so very much!!!
ALL day i have been trying to figure out how to make this work before pestering you folks. The actual SQL statement is much longer, but all of it works fine until i stick that last date field into it. I keep getting a syntax error and i don't know how many more combinations of # and " i can come up with, even though the same combination as i thought i learned works fine in another DATE/TIME field in the middle of same actual string. And before anyone asks (though i seriously doubt it would throw a syntax error) because i have seen a lot of squirrely things with VBA in working with Excel, i verified that the TimeStamp field was Date/TIME (Actually was DATE/TIME EXTENDED at first, but jic i switched it to plain DATE/TIME), and i verified dtNow was type 7...
Code:
DoCmd.RunSQL "INSERT INTO tblAddress (IDCustomer, TimeStamp) VALUES(" & lIDCustomer & ", #" & dtNow & "#);"
What am i doing wrong here?
Thank you so very much!!!