How to add a record to a table programatically?

  • Thread starter Thread starter BT
  • Start date Start date
B

BT

I have my database set up to where I can press a certain
button and it will capture a "snapshot" of the data on the
server into a set of local tables. What I am wanting to
do, is every time this button is pressed, it will add a
date/time record into a seperate table, so that I will
have a log of every time a data snapshot has been taken. I
can't seem to figure out how to make this work through
code. Anyone have any suggestions?

Thanks
 
BT

DoCmd.RunSql "INSERT INTO Foo (Bar) SELECT Date()"

Will insert todays date into a new row in Column Bar of Table Foo.

DoCmd.RunSql "INSERT INTO Foo (Bar) SELECT Now()"

Will insert todays date and time into a new row in Column Bar of Table Foo.

Ron W
 
Back
Top