Auto Fill In 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 ?
 
Ad

Advertisements

A

AlCamp

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
 
J

JohnFol

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

Guest

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
 
J

JohnFol

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.
 
C

Chris Reveille

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
 
Ad

Advertisements

A

AlCamp

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
 
Ad

Advertisements

A

AlCamp

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
 

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

Similar Threads

Auto Fill Date 1
auto fill last used date 1
AUTO FILL? 2
Auto Fill 5
auto fill 4
auto fill 1
auto fill 1
auto fill 1

Top