Date Function in Macro returns 12:00:10 AM

ajarrell

Registered User.
Local time
Today, 01:53
Joined
Feb 4, 2014
Messages
56
In Access, I Created a Macro with:

Condition: [Forms]![frmContacts]![NewRecord]=True
Action: SetValue
Arguments: [Forms]![frmContacts]![RecAdded],=Date()


The Condition part seems to work as desired, but when it is true, the field [RecAdded] is set to "12:00:10 AM".

I want to record the date a new record was added to the database, and would very much appreciate help in getting this problem resolved.
 
Your predicament does not jibe with anything.

There is no way that assigning the value of Date() performed as shown here would give you the result you show. Another assignment must have been done elsewhere (than in this macro).

In the table design, set the default value of the field to Date()
 
Last edited:
Now, my macro is returning 12:01:26 AM. I am attaching a db file with a form, frmContacts. Entering a new record will demonstrate the problem. I am hopeful that someone can help. Thank you in advance!
 

Attachments

edit your macro remove the first line ("If ...[newrecord)
activate this macro in the Before Insert on your form.
 
Setting the default value was exactly what I needed. I didn't know that property existed. Thank you!
 

Users who are viewing this thread

Back
Top Bottom