dbTalk Databases Forums  

auto populate time 'time out' field when user comes into a record thesecond time.

comp.databases.ms-access comp.databases.ms-access


Discuss auto populate time 'time out' field when user comes into a record thesecond time. in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David
 
Posts: n/a

Default auto populate time 'time out' field when user comes into a record thesecond time. - 06-28-2010 , 09:17 PM






Hi, I am trying to have a 'time out' field auto populate when the user
comes into the record the second time. The first time when the user
creates the record, the 'time in' field is auto populated by the code:
Format(Time(),"Medium Time") in the table's default value. The user
opens the record the second time through a form. I have tried to use
the above code in the empty 'time out' textbox's default value, but
nothing happens. I have also tried 'if' statements in the 'on open
Event Procedure', but have not been successful yet. Can anyone help
me? Thanks much. David

Reply With Quote
  #2  
Old   
Marshall Barton
 
Posts: n/a

Default Re: auto populate time 'time out' field when user comes into a record the second time. - 06-29-2010 , 12:17 AM






David wrote:

Quote:
Hi, I am trying to have a 'time out' field auto populate when the user
comes into the record the second time. The first time when the user
creates the record, the 'time in' field is auto populated by the code:
Format(Time(),"Medium Time") in the table's default value. The user
opens the record the second time through a form. I have tried to use
the above code in the empty 'time out' textbox's default value, but
nothing happens. I have also tried 'if' statements in the 'on open
Event Procedure', but have not been successful yet.

The DefaultValue property is only applied at the time of the
first character is entered in a NEW record. SInce the
record obviously exist the second time, this property is
useless for your purpose. The Open event is to soon to set
a control's value, so that won't work either.

OTOH, if the form is opened filtered to only the correct
record (this is essential), without having to navigate to
it, you can use the Load event procedure to set the time out
field's value:
Me.[time out] = Time()

BTW, your DefaultValue expression can simply use:
Time()

--
Marsh

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.