newbie, error in Dim statement 
Author Message
 newbie, error in Dim statement

Hi , sorry if this seems stupid

I've placed the following in the onload method of a form and in a function
module:

Option Compare Database

Option Explicit

Function ValidateReg()
On Error GoTo Err_ValidateReg
Dim db As Database -----------------------> error
Dim rst As Recordset

But I keep getting an error message  saying        (! Compile error
User-Defined Type Not Defined) and the compiler highlights the

declarationn  statement                        Dim db as Database     , I've
use the same code many times without any problems , can anyone tell me
wath's wrong??????

thanks in advanced



Sat, 04 Dec 2004 02:47:43 GMT  
 newbie, error in Dim statement
See responses to the thread "Var Type Conversion in XP" also posted today.

Jack Doria


Quote:
> Hi , sorry if this seems stupid

> I've placed the following in the onload method of a form and in a function
> module:

> Option Compare Database

> Option Explicit

> Function ValidateReg()
> On Error GoTo Err_ValidateReg
> Dim db As Database -----------------------> error
> Dim rst As Recordset

> But I keep getting an error message  saying        (! Compile error
> User-Defined Type Not Defined) and the compiler highlights the

> declarationn  statement                        Dim db as Database     ,
I've
> use the same code many times without any problems , can anyone tell me
> wath's wrong??????

> thanks in advanced



Sat, 04 Dec 2004 03:09:29 GMT  
 newbie, error in Dim statement
In the VB editor select tools then references and then
your favorite object collection that contains a 'database'
object. looks like you want the Microsoft DAO 3.51 Object
library (or 3.6). Simply check the box next to either one
of these and your code will work.

no...this isnt stupid or even obvious...MS likes to hide
some things

   -Dan-

Quote:
>-----Original Message-----
>Hi , sorry if this seems stupid

>I've placed the following in the onload method of a form
and in a function
>module:

>Option Compare Database

>Option Explicit

>Function ValidateReg()
>On Error GoTo Err_ValidateReg
>Dim db As Database -----------------------> error
>Dim rst As Recordset

>But I keep getting an error message  saying        (!
Compile error
>User-Defined Type Not Defined) and the compiler
highlights the

>declarationn  statement                        Dim db as
Database     , I've
>use the same code many times without any problems , can
anyone tell me
>wath's wrong??????

>thanks in advanced

>.



Sat, 04 Dec 2004 05:14:16 GMT  
 newbie, error in Dim statement
It is DAO 3.6, Dan.

If Reyes uses A97, he wouldn't have this problem.  Since he has this
problem, he must be using A2K or AXP and the correct version of DAO for A2K
and AXP is 3.6.

--
HTH
Van T. Dinh
MVP (Access)


Quote:
> In the VB editor select tools then references and then
> your favorite object collection that contains a 'database'
> object. looks like you want the Microsoft DAO 3.51 Object
> library (or 3.6). Simply check the box next to either one
> of these and your code will work.

> no...this isnt stupid or even obvious...MS likes to hide
> some things

>    -Dan-



Sat, 04 Dec 2004 11:16:08 GMT  
 newbie, error in Dim statement
Hey thanks, that did it!!!!!!

Regards


Quote:
> In the VB editor select tools then references and then
> your favorite object collection that contains a 'database'
> object. looks like you want the Microsoft DAO 3.51 Object
> library (or 3.6). Simply check the box next to either one
> of these and your code will work.

> no...this isnt stupid or even obvious...MS likes to hide
> some things

>    -Dan-
> >-----Original Message-----
> >Hi , sorry if this seems stupid

> >I've placed the following in the onload method of a form
> and in a function
> >module:

> >Option Compare Database

> >Option Explicit

> >Function ValidateReg()
> >On Error GoTo Err_ValidateReg
> >Dim db As Database -----------------------> error
> >Dim rst As Recordset

> >But I keep getting an error message  saying        (!
> Compile error
> >User-Defined Type Not Defined) and the compiler
> highlights the

> >declarationn  statement                        Dim db as
> Database     , I've
> >use the same code many times without any problems , can
> anyone tell me
> >wath's wrong??????

> >thanks in advanced

> >.



Sun, 05 Dec 2004 02:07:53 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. vb5 and dim database statement error. Please help

2. Newbie Question: Dim A() as String /Dim A as String()

3. Why does this SQL statement give error? - Newbie

4. Help with DIM statement

5. DIM Statement

6. Don't understand dim statements

7. Dim Statement

8. Dim statements skipped

9. DIM statement using variables

10. Dim statement trivia

11. "late" DIM statements

12. dim statement

 

 
Powered by phpBB® Forum Software