data sql vba

  • Thread starter Thread starter Georges
  • Start date Start date
G

Georges

Hi,

Which vba-code do i need to add the current date into a table (tbldate) only
with a click from a buttum on a form. I use Ac2000.
This tbldate has only one field because each date is unique.

regards Georges
 
Which vba-code do i need to add the current date into a table
(tbldate) only with a click from a buttum on a form. I use Ac2000.

This uses DAO -- it's a little bit different if you want to use ADO.

strSQL = "INSERT INTO MyDateTable (MyDateField) " & _
"VALUES (DATE())"
CurrentDB().Execute strSQL, dbFailOnError
This tbldate has only one field because each date is unique.

This is very strange: if there is nothing else in the record, how do you
know what date applies to what?

HTH


Tim F
 
Back
Top