Compile error - User defined type not defined

  • Thread starter Thread starter ChuckW
  • Start date Start date
C

ChuckW

Hi,

I copied some forms, queries, and reports from one access
database to another. When I go to run the report in the
new access database, I get a compile error - User defined
type not defined. I don't know too much VBA. Someone
actually wrote the vba for me that helps run this
report. The error highlights the "Private Sub
cmdReport_Click()" line in yellow and the highlights in
blue the next line which is "Dim qdf as DAO.Query.Def".
Can someone help me with this?

Thanks,

Chuck

Here are the first few lines of the VBA code:

Option Compare Database
Option Explicit

Private Sub cmdReport_Click()
Dim qdf As DAO.QueryDef
Dim db As DAO.Database
Dim varItem As Variant
Dim StrWhere As String
 
ChuckW said:
I copied some forms, queries, and reports from one access
database to another. When I go to run the report in the
new access database, I get a compile error - User defined
type not defined. I don't know too much VBA. Someone
actually wrote the vba for me that helps run this
report. The error highlights the "Private Sub
cmdReport_Click()" line in yellow and the highlights in
blue the next line which is "Dim qdf as DAO.Query.Def".
Can someone help me with this?


Go back to the original database and make a note of each
library in the list of checked references (VB Editor - Tools
menu). Then fix the list of checked references in the new
databse to match.
 
Back
Top