MS Access - Create activity log

Hello, I would like to create an activity log for my database
Here's what I've got and what I am looking for -
This database is for the management of a Doggy Daycare
The form that I am working on has two listboxes one for checked in dogs the other for checked out dogs.
I have two buttons one that checks the dogs in and one that checks the dogs out.
What I am trying to do is have these activities logged when the actions are taken out.

I have started by creating a table called activities - the fields are :
a number field to link the activity to the record of the dog
a text field called activity that will display the activity that takes place (Checkin, Checkout)
and a Date time field that I would like to have automatically fill with the time of when the button is pushed

In conclusion - I need help writing the commands that will create a record that inserts the appropriate activity (depending on which button is pushed - checkedin/out), logs the date and time, and also correlates to the correct record in the Dogs table.
 
Hope this makes sense - any help would be great!!
Thank You!
geekhelpAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
donpricejrConnect With a Mentor Commented:
>>I don't think (but i'm not sure) that access has a timestamp function, but no biggie - just pass the current time direct from your application.<<

Access does have timestamp functionality--in table design mode enter a new field and name it "timeStamp"; select "Date/Time" as the Data Type; then, for the Default Value enter Now(). This will enter the current date and time each time you write a record to the table.

-Don
0
 
b_smith_79Commented:
You have it about right, but there's no point using a text field for activity - if there are only 2 possible activities, use a BIT data type and make 0 "check out" and 1 "check in". What's your database platform?
0
 
geekhelpAuthor Commented:
Access 2003  is that what you mean by platform ? I have been building the commands in VB i think
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
geekhelpAuthor Commented:
and there will eventually be more activities - Grooming, Overnight Care, Add Passes to Account
but still only 4 or 5 choices - whats the best for that?
0
 
b_smith_79Commented:
Access, OK. That's what I meant, yeah. Best design strategy is never to repeat text data - if there are going to be a bunch of different choices, use an int value. You can then either link that int to the primary key of another table that contains all your activity types (if you want it to be updateable from the application) or to a lookup table somewhere in your code (the first option is my preferred one).

I don't think (but i'm not sure) that access has a timestamp function, but no biggie - just pass the current time direct from your application.
0
 
b_smith_79Commented:
Oh well there you go...do that then :)
0
All Courses

From novice to tech pro — start learning today.