Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2005

Tip: Looking for answers? Try searching our database.

Auto Fill In Date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
George - 18 Mar 2005 14:01 GMT
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 ?
AlCamp - 18 Mar 2005 14:27 GMT
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

> 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 ?
JohnFol - 18 Mar 2005 14:51 GMT
If the Name field (again, another word with other meanings) is a mandatory
field, just set the default value of the field to Date()

> George,
>   First, "Date" is a reserved word, so don't use it as a field name.
[quoted text clipped - 15 lines]
>> 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 - 18 Mar 2005 15:13 GMT
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

> If the Name field (again, another word with other meanings) is a mandatory
> field, just set the default value of the field to Date()
[quoted text clipped - 18 lines]
> >> 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 ?
JohnFol - 18 Mar 2005 16:45 GMT
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.

>I only want the Date field to fill in if the name field get filled in.
>Here's
[quoted text clipped - 33 lines]
>> >> with
>> >> today's date only when the name field in that row get's filled in ?
Chris Reveille - 18 Mar 2005 21:26 GMT
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
[quoted text clipped - 31 lines]
>>
>.
AlCamp - 18 Mar 2005 23:48 GMT
>I only want the Date field to fill in if the name field get filled in.
>Here's
[quoted text clipped - 33 lines]
>> >> with
>> >> today's date only when the name field in that row get's filled in ?
AlCamp - 18 Mar 2005 23:51 GMT
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

>I only want the Date field to fill in if the name field get filled in.
>Here's
[quoted text clipped - 33 lines]
>> >> with
>> >> today's date only when the name field in that row get's filled in ?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.