Solved

MS Access - Create activity log

Posted on 2004-03-28
10
993 Views
Last Modified: 2010-05-18
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!
0
Comment
Question by:geekhelp
  • 3
  • 2
10 Comments
 
LVL 2

Expert Comment

by:b_smith_79
Comment Utility
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
 

Author Comment

by:geekhelp
Comment Utility
Access 2003  is that what you mean by platform ? I have been building the commands in VB i think
0
 

Author Comment

by:geekhelp
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 2

Expert Comment

by:b_smith_79
Comment Utility
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
 
LVL 7

Accepted Solution

by:
donpricejr earned 500 total points
Comment Utility
>>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
 
LVL 2

Expert Comment

by:b_smith_79
Comment Utility
Oh well there you go...do that then :)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now