I am trying to run the following code:
DoCmd.RunSQL "Update mytable SET TimeVariable = #" & Now() & "#"
...however, sometimes it seems to work and sometimes it doesn't. Is there any quick fix? I'm guessing that it needs the date in # signs, but not the time. This line is part of a more complex function and I'd rather not have to declare a recordset and update the table that way. Any ideas? Thanks!
DoCmd.RunSQL "Update mytable SET TimeVariable = #" & Now() & "#"
...however, sometimes it seems to work and sometimes it doesn't. Is there any quick fix? I'm guessing that it needs the date in # signs, but not the time. This line is part of a more complex function and I'd rather not have to declare a recordset and update the table that way. Any ideas? Thanks!