Re: Null date field
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Sun, 27 Aug 2006 00:16:17 +0800
If the record is created without a date, the value is Null.
If you enter a date, and then use backspace to remove the date, the value
becomes Null again.
Entering a space is not the same thing as entering a value, and could
trigger an error message that spaces are not the correct data type.
The error message you reported is not the standard one, so perhaps there is
something in the Validation Text property, or in the BeforeUpdate event of
the control the Error event of the form to give the custom message.
There may also be something in the Input Mask property, which is frustrating
and does nothing useful for dates.
If you wanted to programmatically assign the Null value to the control named
MyDate, the code would be:
Me.[MyDate] = Null
If there is already a half-entered date in the control, you may have to
clear the entry (by pressing Esc) before that would work.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"swtrader" <danrouse@xxxxxxxxx> wrote in message
news:1156608061.064541.304050@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I've read a long discourse which details a problem similar to mine but
I'm still confused.
Given: a date field in my table and on a form. When the record is
first created, the date field is Null (correct?) or is it Empty?
In any event, if a user enters a date in the field (on the form) and
then determines that there should be no date (because the date really
was for an adjacent record or somesuch), attempting to 'clear' the date
(by entering the SPACE bar, for example) results in an error message:
"Idiot, you have to enter something in the date format "nn/nn/nnnn".
There is no 'correct' date to enter since there is no date (a check
hasn't been received yet, for example) so forcing 'some' date into the
field doesn't work.
I would like to be able to set a Double-click event that would re-set
the field to Empty or Null.
????
.
- References:
- Null date field
- From: swtrader
- Null date field
- Prev by Date: Re: email addresses in a database
- Next by Date: Re: Null date field
- Previous by thread: Null date field
- Next by thread: Re: Null date field
- Index(es):
Relevant Pages
|