Is there a way to have a form record date/time only on first entry?

stell

Registered User.
Local time
Today, 07:47
Joined
Jun 14, 2017
Messages
15
Hello. I have a form I am using for data entry, and it records the date and time every time there is a new entry. However, there are instances where people may have to go back and change information in a record. Whenever this happens, the date/time updates to whatever time the modification was made. Can anyone help me find a solution so the date/time does not update when the modification is made? Right now I am using a 'before update' event to record the date/time.

Thank you.
 
Add a condition to only populate the date field where it is null
 
Whenever this happens, the date/time updates to whatever time the modification was made.

Don't do this then.

Right now I am using a 'before update' event to record the date/time

Don't do this either. Just set the default value for this field at the table level. When the record is created it gets the Date/Time. Coding often isn't the solution.
 
Add a condition to only populate the date field where it is null

Thanks for the response, I believe this will solve my problems. I tried changing up my programming but I seemed to have messed something up. Does this pic look right?

EDIT: disregard. I figured out I should be using "is null" instead of using the equal sign
 

Attachments

  • ACCESS.PNG
    ACCESS.PNG
    5.3 KB · Views: 221
Last edited:
Don't do this then.



Don't do this either. Just set the default value for this field at the table level. When the record is created it gets the Date/Time. Coding often isn't the solution.

Thanks for the response, problem with this method is that the second they create a new record it will record the time/date, even if they don't necessarily enter the data until later.
 
Thanks for the response, problem with this method is that the second they create a new record it will record the time/date, even if they don't necessarily enter the data until later.

There's no reason for the date/time to be recorded automatically.
You can disable or modify the code that is doing that.
 
use IsNull([Date]) on your macro.
 
Can anyone help me find a solution so the date/time does not update when the modification is made? Right now I am using a 'before update' event to record the date/time.

If you don't want to use the Default Value Property, the other pretty much standard way would be to only assign the date when the Record is a New Record:

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)

 If Me.NewRecord Then
   Me.DateCreated = Date
 End If

End Sub

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom