User-defined type not defined (Access 2000) 
Author Message
 User-defined type not defined (Access 2000)

I can run this code in Access 97 with no problems, but
when we use this same code in an Access 2000 form I get an
error stating "User-defined type not defined" and the area
highlight is "dbs as database".  What is wrong with this?  
I am new to Access 2000, I havespent my time with Access
97.

The code:
Dim DBS As Database
Dim RST As Recordset
Dim x, y

Set DBS = CurrentDb()
Set RST = DBS.OpenRecordset("temp_table")
DoCmd.SetWarnings False
'MsgBox RST.RecordCount
RST.MoveFirst
y = 0
While Not RST.EOF
    x = RST!tempcount
    DoCmd.RunSQL "UPDATE temp_table SET t1 = " & y & "
WHERE tempcount = " & x & ";"
    y = y + 0.5
    RST.MoveNext
Wend
DoCmd.SetWarnings True

Thanks for the help.

-Mike



Tue, 10 Aug 2004 03:29:01 GMT  
 User-defined type not defined (Access 2000)
These types are defined in the DAO object library.  By default, the DAO
object library is not referenced in an Access 2000 database (ADO is
instead).  To solve the problem:

1.  In the Microsoft Visual Basic window, choose References from the Tools
menu.

2.  In the list of available references, check "Microsoft DAO 3.6 Object
Library".

3.  Use the Priority buttons to move the entry for "Microsoft DAO 3.6 Object
Library" above the entry for "Microsoft ActiveX Data Objects 2.1 Library".
This is to resolve conflicts between types in DAO and ADO (like Field) that
have the same name.  You can also avoid these conflicts by qualifying your
variable declarations, as in:

Dim fld As DAO.Field

instead of

Dim fld As Field

4.  Click OK.


Quote:
> I can run this code in Access 97 with no problems, but
> when we use this same code in an Access 2000 form I get an
> error stating "User-defined type not defined" and the area
> highlight is "dbs as database".  What is wrong with this?
> I am new to Access 2000, I havespent my time with Access
> 97.

> The code:
> Dim DBS As Database
> Dim RST As Recordset
> Dim x, y

> Set DBS = CurrentDb()
> Set RST = DBS.OpenRecordset("temp_table")
> DoCmd.SetWarnings False
> 'MsgBox RST.RecordCount
> RST.MoveFirst
> y = 0
> While Not RST.EOF
>     x = RST!tempcount
>     DoCmd.RunSQL "UPDATE temp_table SET t1 = " & y & "
> WHERE tempcount = " & x & ";"
>     y = y + 0.5
>     RST.MoveNext
> Wend
> DoCmd.SetWarnings True

> Thanks for the help.

> -Mike



Tue, 10 Aug 2004 03:45:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. User-defined type not defined (Access 97)

2. User Control - User-defined type not defined

3. User Defined Type Not Defined

4. Compile Error: User-defined type not defined

5. Excel : User-defined type not define

6. Compile Error - User defined type not defined

7. Dim oappWD as Word.Application: User defined type not defined

8. User- Defined type not defined

9. User Define Type Not Defined

10. FileSystemObject "User Defined Type Not Defined"

11. Compile Error - User-Defined type not defined

12. "User defined type, not defined"

 

 
Powered by phpBB® Forum Software