My Assistant
![]() ![]() |
|
|
Dec 6 2005, 06:37 PM
Post
#1
|
|
|
New Member Posts: 12 |
Hi,
Can you tell me how to insert the current time into a field using a form? I have a table ("Working_in") that has a field called "Time_out" which I want to insert the current time using a form ("Logout"). Any help would be greatly appreciated! Thank You |
|
|
|
Dec 6 2005, 06:45 PM
Post
#2
|
|
|
UtterAccess Guru Posts: 753 From: Rendon, Texas |
Is this what your looking for?
= Time() Time and Date =Now() HTH, Shane |
|
|
|
Dec 6 2005, 06:58 PM
Post
#3
|
|
|
UtterAccess VIP Posts: 13,031 From: Leicester, UK |
Shane has posted how you actually get the time (or date and time).
You need to decide how you actually get that into the table... There are several methods you could use but it is hard to suggest the best method without knowing more about what you are trying to achieve. Do you need to add the time against a specific record? It sounds like you are logging the time a user logged out? How do you know which user it is? Do you also hold the userID in the "working_in" table? |
|
|
|
Dec 6 2005, 07:39 PM
Post
#4
|
|
|
New Member Posts: 12 |
Wow, ok, I am trying to regain my composure. Ok, let me see. We are students working on a class project. Our assignment is to build a "Movie Store" database, that will keep track of movie rentals as well as employee time. So far the only thing that we have gotten to work 100% without error, is the splash screen, everything else either doesn't work or doesn't work right. If anyone would like a copy of the actuall database please just let me know and we would be glad to send you a copy, we would be greatful for the help.
Anyway, what we have so far is a table called "Working_in" which has fields: Autonumber (primary key), Employee_Number, Date, Time_In, Time_Out. Autonumber- This field is just that the primary key, formatted as autonumber. Employee_Number - This field was supposed to be the primary key, but access would not allow it. It should be the primary key, because you can only log in once, therefore you would never have any duplicates, but for some reason it would not work. This field is defined as a lookup, it displays the contents of the "Employee" table. This field is formatted as a number. Date - This field appears to be working properly. It is formatted as date/time. It has a default value defined in the table definition of "Date()." Time_in - This field also appears to be working. It is formatted as date/time. It has a default value defined in the table definition of "Time()." Time_out - This field is not working. It is currently formatted as date/time. I am using a form called "Logout" which consists of: Employee_Number, Employee_Lname, and Time_out. Employee_Number - This field is defined in the 'Row Source' dialog box to display the "Working_in" Employee.Number. This appears to be working as it only shows the employees that are currently "Logged In" according to the "Working_in" table. Employee_Lname - This field appears to be working and automatically pops up the correct last name based on the Employee_Number keyed into or selected from the "Employee_Number" field. Time_out - This field, once again is defined in the "Working_in" table as date/in and is defined in the data tab of the form with a default value of "Time()." Well, I hope this is enough information so that you might help us. Although this might not be the proper forum, while I have you, might you also give us a clue as to what we should do to have other fields automatically fill with data based on what is keyed into or selected from other fields? Specifically, when a movie is chosen in a rental form, how would we have the "movie_code" and "Movie_fee" automatically pop up? Thank You, Desperate
Attached File(s)
|
|
|
|
Dec 6 2005, 07:41 PM
Post
#5
|
|
|
New Member Posts: 12 |
Hi Shane,
We have submitted another post with much more detail, that post might clear things up. Thank You |
|
|
|
Dec 6 2005, 08:08 PM
Post
#6
|
|
|
UtterAccess VIP Posts: 13,031 From: Leicester, UK |
LOL!! The video store database is a very common assignment... there are many threads on it... You will find some good info here
http://www.utteraccess.com/forums/showflat...p;Number=684993 I'll start you off... the most important thing when designing a database is to make sure that it starts off and remains normalised... this means getting the structure right... I would suggest that your Structure should be something like... Tbl_MediaType MediaTypeID (PK - Autonumber) MediaType (i.e. VHS Video, DVD, Computer Game etc...) Tbl_Media MediaID (PK - Autonumber) MediaTypeID (FK) MediaName MediaPurchaseDate CostOfMediaRental Tbl_People PersonID (PK - Autonumber) PersonTitle (mr, Mrs etc...) PersonFirstName PersonSurName PersonCreatedDate Tbl_Addresses AddressID (PK - Autonumber) PersonID (FK) AddressLine1 AddressLine2 AddressLine3 City County Country PostalCode Tbl_CommunicationsType CommunicationsTypeID (PK - Autonumber) CommunicationsType (i.e. telephone, mobile, e-mail etc...) Tbl_PersonCommunication PersonCommunicationID (PK - Autonumber) PersonID (FK) CommunicationsTypeID (FK) CommunicationDetails Tbl_Employee EmployeeID (PK - Autonumber) PersonID (FK) Tbl_RentalSession RentalSessionID (PK - Autonumber) PersonID (FK) RentalDate RentalTime Tbl_RentalItems RentalItemID (PK - Autonumber) RentalSessionID (FK) MediaID (FK) ReturnDate ReturnTime That should get you started. |
|
|
|
Dec 6 2005, 08:18 PM
Post
#7
|
|
|
New Member Posts: 12 |
Thank You! We will take an indepth look at your suggestions as well as the link you provided.
Thank you again! |
|
|
|
Dec 7 2005, 03:42 AM
Post
#8
|
|
|
UtterAccess VIP Posts: 13,031 From: Leicester, UK |
you're welcome.
Again I can't stress enough how important the structure is. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 19th June 2013 - 06:00 AM |