user-defined type not defined

P

Pieter

I have an Access 97 program converted to Access 2002. While running a
specific part of the program I received the error "user-defined type not
defined" on the Dim command.

Private Sub Form_Load()
DoCmd.Maximize
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("Testlog")
If rst.BOF = False Then
Me.Tester = rst![Tester]
Me.Tester.Requery
Me.Witness = rst![Witness]
Me.Witness.Requery
Me.Observer = rst![Observer]
Me.Observer.Requery
End If
DoCmd.OpenForm "Prerequisite"
End Sub

Under Tools, References the following is already set:

Visual Basic For Apllications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library
Microsoft DAO 3.6 Object Library
Microsoft Visual Basic for Applications Extensibility 5.3
 
A

Allen Browne

There is a problem with the way your references are registered.

Under Tools | References from the code window, deselect any libraries you do
not need (such as OLE Automation, ADO 2.1, and VBA Extensibility) and also
the DAO library.
Close. Reopen, and reselect the DAO 3.6 library.
 
P

Pieter

Thanks Allen for you quick reply, but the problem is still there. At this
moment under Tools|References is selected:

Visual Basic For Apllications
Microsoft Access 10.0 Object Library
Microsoft DAO 3.6 Object Library


Allen Browne said:
There is a problem with the way your references are registered.

Under Tools | References from the code window, deselect any libraries you do
not need (such as OLE Automation, ADO 2.1, and VBA Extensibility) and also
the DAO library.
Close. Reopen, and reselect the DAO 3.6 library.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Pieter said:
I have an Access 97 program converted to Access 2002. While running a
specific part of the program I received the error "user-defined type not
defined" on the Dim command.

Private Sub Form_Load()
DoCmd.Maximize
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("Testlog")
If rst.BOF = False Then
Me.Tester = rst![Tester]
Me.Tester.Requery
Me.Witness = rst![Witness]
Me.Witness.Requery
Me.Observer = rst![Observer]
Me.Observer.Requery
End If
DoCmd.OpenForm "Prerequisite"
End Sub

Under Tools, References the following is already set:

Visual Basic For Apllications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library
Microsoft DAO 3.6 Object Library
Microsoft Visual Basic for Applications Extensibility 5.3
 
A

Allen Browne

If the line:
Dim rst As DAO.Recordset
is returning the error:
user-defined type not defined
then Access is not recognising the Recordset object as a valid member of the
DAO library.

Open the Immediate Window (Ctrl+G).
Enter:
? References("DAO").FullPath

Then close Access, and re-register the library with Windows, by entering
something like this:
regsvr32 "c:\program files\common files\microsoft shared\dao\dao360.dll"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Pieter said:
Thanks Allen for you quick reply, but the problem is still there. At this
moment under Tools|References is selected:

Visual Basic For Apllications
Microsoft Access 10.0 Object Library
Microsoft DAO 3.6 Object Library


Allen Browne said:
There is a problem with the way your references are registered.

Under Tools | References from the code window, deselect any libraries you
do
not need (such as OLE Automation, ADO 2.1, and VBA Extensibility) and
also
the DAO library.
Close. Reopen, and reselect the DAO 3.6 library.


Pieter said:
I have an Access 97 program converted to Access 2002. While running a
specific part of the program I received the error "user-defined type
not
defined" on the Dim command.

Private Sub Form_Load()
DoCmd.Maximize
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("Testlog")
If rst.BOF = False Then
Me.Tester = rst![Tester]
Me.Tester.Requery
Me.Witness = rst![Witness]
Me.Witness.Requery
Me.Observer = rst![Observer]
Me.Observer.Requery
End If
DoCmd.OpenForm "Prerequisite"
End Sub

Under Tools, References the following is already set:

Visual Basic For Apllications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library
Microsoft DAO 3.6 Object Library
Microsoft Visual Basic for Applications Extensibility 5.3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top