Time/Date Autofill only on certain field Enter

K

Kyle

I need to set a specific condition on two fields on my
form. Time/Date field name "Date Stamped" & Initial. The
Date Stamped field is default to Now()which is autofill in
the current time/date. I want the user able to enter all
other fields in the form but the Date Stamped field will
not update until the user enter the Initial field then the
time/date autofill in.

How do I setup to accomplised this task.
Thanks in advance for any help.
 
J

John Vinson

I need to set a specific condition on two fields on my
form. Time/Date field name "Date Stamped" & Initial. The
Date Stamped field is default to Now()which is autofill in
the current time/date. I want the user able to enter all
other fields in the form but the Date Stamped field will
not update until the user enter the Initial field then the
time/date autofill in.

How do I setup to accomplised this task.

You'll need to do all your data entry with a Form - table datasheets
don't have any usable events for this purpose. In the AfterUpdate
event of the Initials control on the Form use code something like

Private Sub Initials_AfterUpdate()
If Me!Initials & "" <> "" Then ' Did the user enter anything?
Me!DateStamped = Now
End If
End Sub

Don't use blanks in fieldnames, if you want to avoid hassles
(especially with regard to upgrading to other DBMS's.)
 
K

Kyle

Somehow the form won't let me do it; When user click on
new record, user select the 1st field which is
Name(Combobox). As soon the user select name from the
list, the Date Stamped field already filled with current
date. Or any other field enter.
I guess it may work as what I would like the form to
behave.
 
J

John Vinson

Somehow the form won't let me do it; When user click on
new record, user select the 1st field which is
Name(Combobox). As soon the user select name from the
list, the Date Stamped field already filled with current
date. Or any other field enter.

It would appear that the Default property of the control, or of the
table field, is set to Date. Remove this default if you want the code
to work as you describe.
 
K

Kyle

I removed the default setting of date in DateStamped field
in table which corrected the problem describe previously.
However, when user enter the initial, the DateStamped field
not fill in automaticlly with this date format Mon, Sept.
22, 2003 @ 08:12:00 (blank) but lockup not allow to advance
to next record. This message come up "The field
'VerificationDetais.DateStamped'can not contain a null
value because the required property for this field is set
to true. Enter a value in the field."

Continue... replied would be appreciated.
 
J

John Vinson

I removed the default setting of date in DateStamped field
in table which corrected the problem describe previously.
However, when user enter the initial, the DateStamped field
not fill in automaticlly with this date format Mon, Sept.
22, 2003 @ 08:12:00 (blank) but lockup not allow to advance
to next record. This message come up "The field
'VerificationDetais.DateStamped'can not contain a null
value because the required property for this field is set
to true. Enter a value in the field."

Please post your actual code, together with the name of the date/time
field, the name of the control in which that field is displayed, and
that control's Format property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top