Error - User defined type not defined (1 Viewer)

adamnorsworthy

Registered User
Joined
Nov 9, 2005
Messages
13
Hi,

On Compiling my assecc database VB code I get the following error message "User defined type not defined". I understand it is beecause I have not declared the Variable Type, but have no idea to exactly which part of the code the error is referring to.

How do I find out WHICH User defined type is not defined, especially when I have not got any (or do not want to use any) user defined types?

Thank you in advanced programming wizards. Kind regards, Adam.
 

GRW

Registered User
Joined
Sep 4, 2001
Messages
19
It's probably something as simple as misspelling a variable type,
for example, somewhere in your code you could of typed

dim str as strin

instead of

dim str as string
 

richary

Registered User
Joined
May 26, 2004
Messages
167
...or it could be a missing reference in your Tools | References dialog
 

adamnorsworthy

Registered User
Joined
Nov 9, 2005
Messages
13
Cheers

Thanks for the replies.

Is there any way I can find out what the problem is without having to go through the code? I have around 12 forms, all with a load of VB code behind them, and I want to avoid going through every bit of code to find the problem.

Cheers again, Adam.
 

GRW

Registered User
Joined
Sep 4, 2001
Messages
19
Thinking of it, when you compile it should highlight where the problem is...
 
D

DOLL

Guest
GRW said:
Thinking of it, when you compile it should highlight where the problem is...
I have to agree with GRW. And most probably, you need to add Microsoft DAO bla bla in the Tools | Preferences. Hope you get to solve the error. :p
 

RCheesley

Registered User
Joined
Aug 12, 2008
Messages
243
Ahar this fixed my problem, I had a missing reference in my VBA window! Woohoo many thanks :)
 

GMurgia

New member
Joined
Sep 28, 2011
Messages
5
I have to agree with GRW. And most probably, you need to add Microsoft DAO bla bla in the Tools | Preferences. Hope you get to solve the error. :p

:confused:

I have the same problem but no reference is missing (and I have DAO 3.6 in office 2007).
The huge amount of VBA doesn't allow manual inspection
 

boblarson

Smeghead
Joined
Jan 12, 2001
Messages
32,068
:confused:

I have the same problem but no reference is missing (and I have DAO 3.6 in office 2007).
The huge amount of VBA doesn't allow manual inspection
Have you gone up to DEBUG > COMPILE <project name> in the VBA Window? It should take you to any compile errors that exist and highlight them.
 

boblarson

Smeghead
Joined
Jan 12, 2001
Messages
32,068
Should but it doesn't.

Thanks
Okay, so let's take a step back for a minute. When are you getting this error? The original poster was getting it when compiling the database and so it was something that was coming up highlighted. What exactly is happening for your situation?

Wait a second (just thought of this as I was typing)- is this an accdb file? If so, then you don't want DAO 3.6 you want Microsoft Office 12.0 Access Database Engine Object Library checked INSTEAD. See if that helps and then you can answer the above questions if that doesn't do the trick.
 

GMurgia

New member
Joined
Sep 28, 2011
Messages
5
Have you gone up to DEBUG > COMPILE <project name> in the VBA Window? It should take you to any compile errors that exist and highlight them.

--------------------------------------------------------------------
Sorry to everybody: probably I replied to someone else rather than you.
--------------------------------------------------------------------

Should highlight, but it doesn't (and I have also rebooted the computer).

Thanks .
 

GMurgia

New member
Joined
Sep 28, 2011
Messages
5
Okay, so let's take a step back for a minute. When are you getting this error? The original poster was getting it when compiling the database and so it was something that was coming up highlighted. What exactly is happening for your situation?

Wait a second (just thought of this as I was typing)- is this an accdb file? If so, then you don't want DAO 3.6 you want Microsoft Office 12.0 Access Database Engine Object Library checked INSTEAD. See if that helps and then you can answer the above questions if that doesn't do the trick.
It is an .mdb file (access 2007, 2002-2003 file format).
I tried to eliminate the code added since the last successful compilation, but no results. It gives the error without highlight anything.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom