Date & Time Dilema

Groundrush

Registered User.
Local time
Today, 18:35
Joined
Apr 14, 2002
Messages
1,376
On my main form when a record is created the date & time will automatically be generated using Me.txtDateReported = Now() on the on click event of a command button

I now need to have the option of back dating the order if required but because the field is set to =now() it will not allow edits

Anyone have any suggestions of achieving both options on the same form?



Thanks
 
Last edited:
Simple Software Solutions

Remove the Now() from the coding when adding the new record. On the default value for the field Me.TxtDateReported insert Now() there. Make sure you make the field unbound. The txtDateReported control will be automatically populated with today's date but the use will be able to override this via the form. The command button will append the date that is in the TxtDateReported control.

You may have to think about date validation at this point. Such as date reported cannot be in the future.

codeMaster::cool:
 
The reason why I have put it in the code is so that the date & time is recorded after the job is logged as it can take some time

If I have it set to default value then the date & time will be logged when the form is first opened not giving an accurate time.
 
Simple Software Solutions

It seams to me that the date/time stamp is mission critical or that it takes a hell of a long time to complete the form?

However, if the time apsect is so critical if as you suggest you want the facitlity to back date the date to a date earlier than today. As per you original question. What time are you entering in here? Surely the user will enter a date but not a time. If they do enter a time, how accurate is that time. At least with my suggestion your time will be more accurate than any spurious time a user might enter.

This is my logic creaping into the situation.

CodeMaster:
 
I found what was causing the problem

I forgot about this code :o

Forms![frmCallLogging].AllowEdits = false


Thanks for you help DCrake :-)
 

Users who are viewing this thread

Back
Top Bottom