Auto Fill In Date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On my form I have several rows of the same fields which are:

Name, Man Number, Date

Question is how can I get the Date fields to automatically fill in with
today's date only when the name field in that row get's filled in ?
 
George,
First, "Date" is a reserved word, so don't use it as a field name.
Use a name that tells you what that date really means, like... HireDate,
StartDate, or RenewDate, etc..

I'd try using the AfterUpdate event of Name.

If IsNull(Name) = False Then
HireDate = Date
End If
hth
Al Camp
 
If the Name field (again, another word with other meanings) is a mandatory
field, just set the default value of the field to Date()
 
I only want the Date field to fill in if the name field get filled in. Here's
what it looks like - they are just text fields.

Name Field = (Text66)
Date Field = (Text72)

I only want the Date Field to show todays date if the Name field gets entered.

Thanks
 
My comment stands. If the name field is mandatory, the record will not be
saved if "Name" is empty / null. As soon as it has a value, the record can
be saved, and hence the date is entered automatically.
 
Try in the after update event on the name field
If not IsNull(Me.[Name]) Then
Me.HireDate = Date()
End If

Chris
-----Original Message-----
I only want the Date field to fill in if the name field get filled in. Here's
what it looks like - they are just text fields.

Name Field = (Text66)
Date Field = (Text72)

I only want the Date Field to show todays date if the Name field gets entered.

Thanks

JohnFol said:
If the Name field (again, another word with other meanings) is a mandatory
field, just set the default value of the field to Date()


AlCamp said:
George,
First, "Date" is a reserved word, so don't use it as a field name.
Use a name that tells you what that date really means, like... HireDate,
StartDate, or RenewDate, etc..

I'd try using the AfterUpdate event of Name.

If IsNull(Name) = False Then
HireDate = Date
End If
hth
Al Camp
 
George said:
I only want the Date field to fill in if the name field get filled in.
Here's
what it looks like - they are just text fields.

Name Field = (Text66)
Date Field = (Text72)

I only want the Date Field to show todays date if the Name field gets
entered.

Thanks
 
I stand by my answer too....
I'd try using the AfterUpdate event of Name.

If IsNull(Name) = False Then
HireDate = Date
End If
Just use your own field names...
Al Camp
 
Back
Top