Solved

MS Access - Create activity log

Posted on 2004-03-28
10
1,127 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
10 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 500 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

627 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