Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form basics

Status
Not open for further replies.

snowolf

Technical User
Apr 7, 2002
1
US
I have a date entered text box on a form that i want to automatically populate with the current date, every time a new form is presented. I want this to happen without a pop-up calendar. The call-in procedure is not working. any solutions?
 
Set the default value of the field in the table to now() or the before update or form current event procedure of the form can set the value in the text box.

Private Sub Form_BeforeUpdate(Cancel As Integer)
if IsNull(the_field) Then
the_field = Now()
End If

Many other methods can be used. Here is how I would do it. It depends on your application.
 
Probably not a bad idea to lock the field as well, to keep users from (inadvertently?) changing it. - - - -

Bry
 
Just set the default value for the field in the properties as
Date()
that's it. Life's a journey enjoy the ride...

jazzz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top