From: gchichester via AccessMonster.com on
Any idea why this short script would display just the time?

Private Sub DispatchHeaderPort_GotFocus()
Dim SDate As Date
MsgBox SDate
End Sub

Please see screenshot in my Gallery

Thanks
Gil

--
Message posted via http://www.accessmonster.com

From: Jon Lewis on
Because Dim SDate As Date is preparing some space in memory for some data of
the type Date, but you are not actually supplying the data.

You need:
Dim SDate As Date
SDate = Date
MsgBox SDate

or just

MsgBox Date

HTH

"gchichester via AccessMonster.com" <u46492(a)uwe> wrote in message
news:a226bb4430b7f(a)uwe...
> Any idea why this short script would display just the time?
>
> Private Sub DispatchHeaderPort_GotFocus()
> Dim SDate As Date
> MsgBox SDate
> End Sub
>
> Please see screenshot in my Gallery
>
> Thanks
> Gil
>
> --
> Message posted via http://www.accessmonster.com
>


From: gchichester via AccessMonster.com on
Jon,

Thanks for pointing out the obvious.
My bad for not including the value from a field on my form.
Gil

Jon Lewis wrote:
>Because Dim SDate As Date is preparing some space in memory for some data of
>the type Date, but you are not actually supplying the data.
>
>You need:
>Dim SDate As Date
>SDate = Date
>MsgBox SDate
>
>or just
>
>MsgBox Date
>
>HTH
>
>> Any idea why this short script would display just the time?
>>
>[quoted text clipped - 7 lines]
>> Thanks
>> Gil

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201001/1