User defined type not defined?

P

PayeDoc

Hello All

I have recently been having some VBA corruption problems, which I have been taking steps to sort out - one of which has been to do Debug>Compile db1 after every amendment I make to any of the code. I have noticed 3 different outcomes of the Debug>Compile db1:

1. Sometimes I get a message "User defined type not defined" - but the cursor does not move to any particular place in the code to give me a clue about what it's on about. Often when this happens, if I just repeat the Debug>Compile db1, it then goes fine, with no message;
2. Sometimes, after doing Debug>Compile db1 and not getting the "User defined type not defined" message, if I then select the Debug menu item I see that the Compile db1 option is greyed out - (which I take to mean that the db is now "in a compiled state");
3. Sometimes, after doing Debug>Compile db1 and not getting the "User defined type not defined" message, if I then select the Debug menu item I see that the Compile db1 option is NOT greyed out: does this mean that the db is NOT "in a compiled state"?

I'm getting a bit out of my comfort zone with this (!), but hope someone can advise me whether I need to be concerned about any of the above.

Thanks for any help.
Leslie Isaacs
 
D

Dorian

(1) is a problem and normally you would be positioned to the offending
statement.
(2) means that the project is compiled
(3) means that the project is not compiled
I'd back up your database and then do a compact/repair. Possibly, you may
need to create a new empty database and import all your objects to it then
reset up your references.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
M

Marshall Barton

PayeDoc said:
I have recently been having some VBA corruption problems, which I have been taking steps to sort out - one of which has been to do Debug>Compile db1 after every amendment I make to any of the code. I have noticed 3 different outcomes of the Debug>Compile db1:

1. Sometimes I get a message "User defined type not defined" - but the cursor does not move to any particular place in the code to give me a clue about what it's on about. Often when this happens, if I just repeat the Debug>Compile db1, it then goes fine, with no message;
2. Sometimes, after doing Debug>Compile db1 and not getting the "User defined type not defined" message, if I then select the Debug menu item I see that the Compile db1 option is greyed out - (which I take to mean that the db is now "in a compiled state");
3. Sometimes, after doing Debug>Compile db1 and not getting the "User defined type not defined" message, if I then select the Debug menu item I see that the Compile db1 option is NOT greyed out: does this mean that the db is NOT "in a compiled state"?

I'm getting a bit out of my comfort zone with this (!), but hope someone can advise me whether I need to be concerned about any of the above.

Those are symptoms of the code project being corrupted. It
can almost always be cleared up by opening Access using the
Decompile option. See
http://www.granite.ab.ca/access/decompile.htm
fo details.

The most common cause of this kind of corruption is editing
code for a form/report when the form/report is running. Try
to get in the habit of ALWAYS switching to design view
BEFORE making ANY change to a form/report's module.
 
L

Leslie Isaacs

Dorian

Thanks for your reply, and for your confirmations of what I had supposed. I
will try your suggestion of importing objects to a new mdb.

Thanks again
Les
 

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