On Thu, 26 Aug 2010 21:37:40 -0400, "LAS" <(E-Mail Removed)> wrote:
>I was just about to post an "oops." The value it has at the beginning is
>12:00:00 AM. (I should have named the variable gdtSession_Date...)
>
>The only place it gets established before a form is opened is in this
>declaraition. When any form is opened, it has the value 12:00:00 AM.
>
>Public gsSession_Date As Date
>
>I used UcoraFindandReplace to be sure that it wasn't getting assigned to
>anything anywhere.
Sorry... it's a VBA variable, not a table field! My answer applied to the
latter.
If you use As Date in the Dim, then the variable must indeed have a value;
it's defaulting to 0.0, which is equivalent to #12/30/1899 00:00:00# and will
indeed be displayed as 12:00:00 AM.
You can test for it being uninitialized by comparing it to #12/30/1899# or to
#12:00:00 AM# or to 0, all of which are just different ways of depicting the
same thing... but it can't be NULL, as a table field can.
--
John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also
http://www.utteraccess.com