Date/time format in the DefaultValue property

L

Laurel

I have a macro that initializes a value in a new record.
If I place it so it works to set the DefaultValue
property, instead of the value itself, the resulting date
contains the current time. If I place it so it works to
set the value itself, the date is as I want it.... no time
included. Why is this, and what could I do about it if I
had no choice but to set the [DefaultValue] property?

This results in the undesired current time in the
Score_Date field:

Item: [Forms]![frmScoreEntryHistory]![Score_Date].
[DefaultValue]
Expression: [Forms]![frmScoreEntryHistory]![cboStudent_ID]


This results in the desired date only in the new record.

Item: [Forms]![frmScoreEntryHistory]![Score_Date].
[DefaultValue]
Expression: [Forms]![frmScoreEntryHistory]![cboStudent_ID]
 
K

Ken Snell

Your two examples appear to be identical.?

ACCESS stores date and time in all date/time fields. You control the display
of that info by formatting a control or the field. But that doesn't change
what's stored in the field itself.

I'm guessing that your cboStudent_ID value is being set using the Now()
function in some way? If you use the Date() function, then the time part
will be stored as ".0". No difference to what you display, but it can make a
big difference in queries if you try to select based on dates.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top