how to add change stamp value in command button

hello am attaching sample database-
open database and enter 123
question:
if you click the Clock In button- it tells you arrived at some time- is it possible to have it actually time stamp a value 30 minutes later?  so 7:00 am - would be 7:30 am
It does not need to display this  new value in the message box- it can be the regular time-
I am not explaining the whole reason here- but if this can be done- it will solve my problem-
thank you
TestRev.mdb
davetoughAsked:
Who is Participating?
 
mbizupCommented:
Use this to assign txtIn:

Me.txtIn = dateadd("n",30,Now())
0
 
MINDSUPERBCommented:
Try to use this:

one = Now() + 0.0208333333

Sincerely,
Ed
0
 
MINDSUPERBCommented:

You may do the same with

Me.txtIn = Now() + 0.0208333333

Ed
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Jeffrey CoachmanMIS LiasonCommented:
<I am not explaining the whole reason here>
Why not?, ...perhaps there is a more efficient technique.

We always see members ask for something and not explain the "why" behind the request.
...just because they need to "Get it done"

This sometimes lead to issues elsewhere in the DB where this "workaround" causes problems.

;-)

JeffCoachman
0
 
davetoughAuthor Commented:
Thank you
0
 
mbizupCommented:
Dave,

Can you explain why you accepted the comment that you did?  My first post was tested - and works in your database.
0
 
davetoughAuthor Commented:
Why:
created time sheet program- in -lunch-return- out ( also out and in -for special times appts.)
then was told keep lunch and return from lunch and out and in behind the scenes and just subtract 30 minutes from clock in and clock out-
did not take into consideration that time would subtract from people when they did not take lunch too.
I thought I could create checkbox to have user check if did not take lunch-
but that would involve creating new fields and have alot of update queries behind scenes in a macro to create reports-
so I realized - I could just add another button on peoples forms- to click if they do not take lunch - and this button would add the 30 minutes back that is automatically being subtracted.
Thank you
0
 
mbizupCommented:
Did you test the DateAdd function that I posted in the first comment?  From what I can tell, it does exactly what you described.
0
 
davetoughAuthor Commented:
am in new york visiting relative- have not got back on here-
explanation-
the first solution did not work when i tried it at work
- now could i have coded wrong- maybe- but most likely not- i placed code in my program and did not change anything- and did not even give me an error-
so i went on to next solution- this is reason-
the program is at work and cannot access now- and also am on another problem now-
so to re-itterate- i did try the solution and it did not work for me
thank you
0
 
mbizupCommented:
<It does not need to display this  new value in the message box>

Okay - the second (accepted) solution only changes what is displayed in the message box  -- it doesn't change the timestamp recorded in your table.

The first and third post actually change the time stamp as it is recorded in the table (but you don't see that value displayed in the message box).

So if you are only using this:
<< one = Now() + 0.0208333333 >>

Then the new value is simply being displayed to the user - not recorded in the table.
0
 
davetoughAuthor Commented:
hello,
i have just downloaded my example- and your are right mbizup- both 1st and third examples change time stamp in table- and i also realize the 3rd example is the one i used in my real program-
So whether the first example worked in the real  program - or not- i will not know for a few days- but i realizeI since it works with my example- i have made a mistake of not accepting your answer first-since that is all you have to go on- i apoligize- i will request attention and see if i can correct this error-
i don't recall how i corrected similar mistakes in the past- but hoping by clicking request attention- i can contact a moderator- my mistake
thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.