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!

Date of Request in Access form 3

Status
Not open for further replies.

kastaman

IS-IT--Management
Sep 24, 2001
181
CA
I have created a form for the users to enter their request details. I have a field that show the date or request. This populates on focus and/or population of a field in the form.

My issue is that the date of request sometimes changes due to being clicked, or the information on the field which triggers the date of request to populate gets changed.

I need help in establishing the proper way of securing the date and also ensuring the the request date field populates when a new request is clicked and will not be affected by other events on the form.

Thanks for your assistance in advance,

Kastaman
 
I may be misunderstanding you, but have you thought about changing the Locked property of the text field on the form? Terry M. Hoey
 
I can lock the field but what script or event procdure do I need to create to ensure that the date of request gets populated once a new request is generated?
 
The date is in general format. At the moment, what triggers the field to populate the date = Now() in on focus of the field.
 
Do you just required a date for each new request?

If so, in the request table, set the date fields default value to Date(). This will add the date to each new record when created. Then all you need to do is set enabled to false on your form to prevent manual changes.

:-9
 
Mikehoot - that is what I need, thanks for you help. One other issue I have is the format of the date, I would like to see the date and time but all I see is the date mm/dd/yyyy.

Kastaman
 
I have but it still does not show mm/dd/tt hh:mm:ss.
It works if I use Now().
Why is that?

Kastaman
 
ok set the focus to the first field in the form


Private Sub datefield_GotFocus()
If Nz(Me.[datefield]) = "" Then
Me.[datefield].Enabled = False
Else
Me.[datefield].Enabled = True
End If

In the field [datefield] set default to =now()

Hope this helps

Zero
 
From my last reply, just replace =Date() with =Now()

:-9
 
thanks to all who assisted me on this.

kastaman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top