How to add a record to a table programatically?

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
 
R

Ron Weiner

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top