Timesheet Table AM/PM

jessabridge

Registered User.
Local time
Today, 18:16
Joined
Jun 29, 2011
Messages
35
Thanks to all your help! I am almost done with this monstrosity! :D My boss would like the Time Out field in my table/form to default to a PM time.

Right now, when you enter Time In - it defaults to AM (ie: if you type in 9:00 - it enters 9:00AM, which is correct). But when you enter in Time Out field - it still defaults to AM (ie: if you type in 4:00 - it enters 4:00AM, when we want 4:00PM). We still want to be able to enter in AM times if needed. We just want that one field to default to a PM time...

Is that possible?
Jessa
 
How exactly do you get the time for the Time Out field?

This link to TimeSerial may be useful.
 
I have a form that is linked to my main table.
On the form you pick a name, then enter the date and the time in and the time out.
Jessa Bridge
5/1/2013
Time in: 8:00AM
Time Out: 4:00PM

The TimeSerial Function thing seems to be for queries. This is for a form and table for plain data entry.

Jessa
 
TimeSerial is not limited to queries.

You could try 16:00 instead of 4:00, or you could add 4:00 to the typed in value.

Is it always on the hour? Could it by 4:27?
How is the Time Out field defined in the underlying table - is it a string/text.

You could click a button instead of typing (and getting typos etc)
and have the button click record the current time using the Time() function.

http://www.techonthenet.com/access/functions/date/time.php
 
They do not want to use military. Thought of that too. :-)
I have formated the field as medium time for Date/Time. The date is in another field. It can be any time during the day. We are not doing seconds but minutes are in there. I thought of doing a drop down but there where to many choices and my boss just wanted data entry. I made a error message pop up if they do AM in time out but I was hoping for a PM default for just that field.

Jessa
 
Have you given any thought to the button approach?
2 buttons

Time-In and Time-Out

When you click the button the Time() gets input to the appropriate field in your table. You could format it to disregard seconds.

What happens if someone does a Time-In but forgets (doesn't) Time-Out?
 
I don't think they will forget. They are right next to each other. They don't have to do it every day, just when timesheets are due. If there is a mistake, they know to go into the main table and edit what is neccessary. I have only been doing access for about 1 1/2 yrs to 2 yrs. Still a newbie. :p I am not sure what you mean by button. Would that default to a PM time?

My boss is fine with the AM being the default option for time in. In time out, she just wants the time to automatically think it is PM. Like, you put in 6:00 and it automatically knows it should be 6:00 PM and switches to that. At the same time, it will still except AM if that is what is typed in....
Jessa
 
Jessa,

If there is a mistake, they know to go into the main table and edit what is neccessary.
Users should NOT be going into tables directly and changing data. That's what forms are for -- controlling the flow, and providing the user with a means to do something (but not the ability to edit and change records without a record of who did what).

If you have been working with Access for over a year and do not recognize "button", I'm not sure what to tell you. It appears that your introduction to Access and Forms/Controls has been extremely limited.

I strongly recommend you watch some YouTube videos -- there are free ones by Richard Rost 599CD that will help you with concepts. He has a whole set for Access2010
https://www.youtube.com/watch?v=hMzf6u8hWqk

You could also help yourself tremendously by reviewing/referencing Access Basics by Crystal Long who is an Access MVP.

Forms and Command Button Control info is in
http://www.accessmvp.com/strive4peace/Access_Basics_Crystal_080113_Chapter_05.pdf

Good luck with your project.
 
Last edited:
I have command buttons. I was saying I did not know how a button in that situation would help me, but I am a beginner. I took 1 basic course and then my boss said ”Make a time sheet database”. A timesheet database is not beginner or basic. LOL I powered thru and it looks great and does what we need with just a few kinks. I know that they should not go into the main table. Forms are my weakness & I could not get multiple day record entries, nor a lookup to prior records. I know that is lacking. But I did write some code (yeah! ) And my iif statements are beautiful!

My question was not answered: is it possible to format my just time out field to PM?

Jessa
 
Yes.

As mentioned in post #6, attached is a jpg showing the concepts related to

Clicking a button to record Time Out and to present that value in the format you want/need.

Good luck with your project.
 

Attachments

  • SampleTimeOut form to show concept.jpg
    SampleTimeOut form to show concept.jpg
    19.5 KB · Views: 164
Yes.

As mentioned in post #6, attached is a jpg showing the concepts related to

Clicking a button to record Time Out and to present that value in the format you want/need.

Good luck with your project.

But that just gives me Medium Time...I think I am missing what you are saying by a long shot! LOL How does that make the time automatically recognized as PM?
Jessa
 
Did you try what I suggested and posted?
You will get the AM PM --- I did in my test.
 
Attach the db in witch you made that test. I dont understand your suggestion!
 
Check this solution!

I can't get into the database. I only have 2003.

At Jdraw@ Current time would not work. They enter the time in and out on other days and sometimes earlier. That would be excellent if they used the database like a time punch.

Jessa
 
There it is in 2003 version. Check the after update code for text2. You will get the idea and work it for your project.
 

Attachments

OMG!!!! That worked! Just what I needed! If you can, but no problem if you can't, can you explain the input mask so I can learn? I tried and failed my input mask experiments.

00:00;0;_

I know that the first part is Medium time. What is the second half?

Jessa
 
All i know is that the last thing, the "_", is the placeholder, the carachter that apears before you insert data. The last "0"... i have no idea!
 

Users who are viewing this thread

Back
Top Bottom