Re: Null date field



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.

????


.



Relevant Pages

  • Re: Re-post: Yet another problem with "no current record"
    ... It is the case that my detail area is ... move focus to another control if there are no records. ... There is a case where Access 2002 SP3 generates this error message afer a ... I set "No Additions" to True in my code, so no empty row shows ...
    (microsoft.public.access.formscoding)
  • post data from a form and special character: " " and " / "
    ... first of all I make a control on the required fields: ... the field is empty some error message will appear.. ... if the field is empty I need to show the form again, ...
    (alt.php)
  • Re: NTSVC.OCX Help needed
    ... "When you use the Services snap-in to start a local service on a Microsoft ... The "cause" is stated as "This arbitrary time limit had been set with the ... error message and continue to check for the service to start. ... you must check the System event log for Service Control ...
    (microsoft.public.vb.general.discussion)
  • Microphone wont work
    ... Control Panel/Sounds and Audio Device/Voice/Testing sound Hardware. ... Windows error message "Windows cannot execute DpvSetup.exe, ... Sounds And Audio Devices icon (in the Sounds, Speech, And Audio Devices ... Now it's time to edit the Registry. ...
    (microsoft.public.windowsxp.hardware)
  • Re: Debit Card Purchase recording
    ... >> End Sub ... > I have this in the After Update Event of the control in the form ... despite the error message you're getting. ... Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.formscoding)