Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MS Access - Create activity log

Posted on 2004-03-28
10
Medium Priority
?
1,169 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
What we learned in Webroot's webinar on multi-vector protection.
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…

719 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