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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto date, please, not dominate

Status
Not open for further replies.

AddictedAccessRookie

Technical User
Mar 25, 2008
1
US
New to Access...set up form that auto enters today's date for my colleagues to enter records using the date() mask. Problem: all data must now be entered TODAY. Form will NOT allow users to backfill with prior dates. Please advise.

Thanks in advance.
 
Did you set the Control Source to =Date or such like? If so, remove the line and use it for the Default Value.
 
How are ya AddictedAccessRookie . . .

Add a Date field to the underlying table. Call it [blue]SaveDate[/blue]. Then in forms [blue]On Current[/blue] event, copy/paste the following:
Code:
[blue]   If Me.NewRecord Or Me!SaveDate = Date Then
      Me.AllowEdits = True
   Else
      Me.AllowEdits = False
   End If[/blue]
Finally, in the [blue]Default Value[/blue] proper of [blue]SaveDate[/blue], copy/paste the following:
Code:
[blue]=Date()[/blue]
Thats it.

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 



TheAceMan1


Won't the code you suggest prevent the users from editing any previous records?



 
Howdy Remou . . .
AddictedAccessRookie said:
[blue] Problem: all data must now be entered TODAY. Form will [purple]NOT allow users to backfill with prior dates.[/purple][/blue]
Not positive on the ops intent of thought here, butit does appear prior dates will not allow editing. [surprise]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top