Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MS Access - Create activity log

Posted on 2004-03-28
10
Medium Priority
?
1,209 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
6 Comments
 
LVL 2

Expert Comment

by:b_smith_79
ID: 10700913
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
ID: 10700950
Access 2003  is that what you mean by platform ? I have been building the commands in VB i think
0
 

Author Comment

by:geekhelp
ID: 10700956
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 2

Expert Comment

by:b_smith_79
ID: 10701126
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 2000 total points
ID: 10704613
>>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
ID: 10709190
Oh well there you go...do that then :)
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
In this article, we’ll look at how to deploy ProxySQL.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

876 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