From: John W. Vinson on 4 Nov 2009 22:44 On Thu, 05 Nov 2009 03:01:57 GMT, "AccessVandal via AccessMonster.com" <u18947(a)uwe> wrote: >Did you correct the code as suggested by Stefan? > >With this >"Dim dwMachineNum, dwEMachineNum, dwYear, dwMonth, dwDay, dwHour, >dwMinute, dwSecond, dwWorkcode, dwReserved As Long" Do note that this dimensions dwReserved as a Long - but dims all of the other variables as Variants, the default. You must use Dim dwMachineNum As Long, dwEMachineNum As Long, dwYear As Long, dwMonth As Long, dwDay As Long, dwHour As Long, dwMinute As Long, dwSecond As Long, dwWorkcode As Long, dwReserved As Long to specify each of the variables as Long. >It's better to include the "Option Explicit" to check for any undeclared >objects in your code just in case there may be typos as well. Absolutely and always. -- John W. Vinson [MVP]
From: yanto on 5 Nov 2009 05:29 On Nov 5, 10:44 am, John W. Vinson <jvinson(a)STOP_SPAM.WysardOfInfo.com> wrote: > On Thu, 05 Nov 2009 03:01:57 GMT, "AccessVandal via AccessMonster.com" > > <u18947(a)uwe> wrote: > >Did you correct the code as suggested by Stefan? > > >With this > >"Dim dwMachineNum, dwEMachineNum, dwYear, dwMonth, dwDay, dwHour, > >dwMinute, dwSecond, dwWorkcode, dwReserved As Long" > > Do note that this dimensions dwReserved as a Long - but dims all of the other > variables as Variants, the default. > > You must use Thanks for all response, I will try soon. > > Dim dwMachineNum As Long, dwEMachineNum As Long, dwYear As Long, dwMonth As > Long, dwDay As Long, dwHour As Long, dwMinute As Long, dwSecond As Long, > dwWorkcode As Long, dwReserved As Long > > to specify each of the variables as Long. > > >It's better to include the "Option Explicit" to check for any undeclared > >objects in your code just in case there may be typos as well. > > Absolutely and always. > -- > > John W. Vinson [MVP]
From: yanto on 5 Nov 2009 05:32 I forget something, the error come out when I close the form and also quit access, because I only have one form On Nov 5, 10:44 am, John W. Vinson <jvinson(a)STOP_SPAM.WysardOfInfo.com> wrote: > On Thu, 05 Nov 2009 03:01:57 GMT, "AccessVandal via AccessMonster.com" > > <u18947(a)uwe> wrote: > >Did you correct the code as suggested by Stefan? > > >With this > >"Dim dwMachineNum, dwEMachineNum, dwYear, dwMonth, dwDay, dwHour, > >dwMinute, dwSecond, dwWorkcode, dwReserved As Long" > > Do note that this dimensions dwReserved as a Long - but dims all of the other > variables as Variants, the default. > > You must use > > Dim dwMachineNum As Long, dwEMachineNum As Long, dwYear As Long, dwMonth As > Long, dwDay As Long, dwHour As Long, dwMinute As Long, dwSecond As Long, > dwWorkcode As Long, dwReserved As Long > > to specify each of the variables as Long. > > >It's better to include the "Option Explicit" to check for any undeclared > >objects in your code just in case there may be typos as well. > > Absolutely and always. > -- > > John W. Vinson [MVP]
First
|
Prev
|
Pages: 1 2 Prev: How to use Seek vs FindFirst Next: code wont recognizie that 10 is greater than 3 |