Prev: Button to Collect Data from Outlook
Next: Lock fields in subform except two after authorization date is ente
From: gchichester via AccessMonster.com on 15 Jan 2010 09:46 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 15 Jan 2010 10:07 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 15 Jan 2010 10:19
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 |