By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,209 Members | 1,092 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,209 IT Pros & Developers. It's quick & easy.

Error after importing forms from backup copy of project

P: n/a
Good morning.

I recently made some changes to my Access project, and I introduced
some problems that I could not resolve. So I deleted the forms that I had
altered and saved the project. Then I opened my backup copy of
the project, and exported the affected forms to the working copy.

Now when I invoke any event procedures in the affected forms,
I receive the following error (this example is for a click event):

"The expression On Click you entered as the event property setting
produced the following error: User-defined type not defined."

I have extensively reworked the database in my working copy,
so I will lose all of that work if I simply roll back to my backup
copy.

Any suggestions on how to solve this error?

Thanks
-Mark
Dec 26 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
The good news is that, unless you took specific action to remove it, the
event code was not deleted along with the Forms. But when you copied the
Forms from your backup database, the code did not come along with them. From
your description, it seems you may not have backed up the DB with the most
recent changes, so this is likely A Good Thing.

The bad news is, if it was something in your event code that was the
problem, you will still have it when you restore, but if you do, you have
valuable debug information from that fact.

All you will have to do, most likely, is to determine which events had event
code, and select "Event Procedure" for that Event in the Form's Properties.

Larry Linson
Microsoft Access MVP
"Mark" <an*******@hotmail.comwrote in message
news:11**************@bubbleator.drizzle.com...
Good morning.

I recently made some changes to my Access project, and I introduced
some problems that I could not resolve. So I deleted the forms that I had
altered and saved the project. Then I opened my backup copy of
the project, and exported the affected forms to the working copy.

Now when I invoke any event procedures in the affected forms,
I receive the following error (this example is for a click event):

"The expression On Click you entered as the event property setting
produced the following error: User-defined type not defined."

I have extensively reworked the database in my working copy,
so I will lose all of that work if I simply roll back to my backup
copy.

Any suggestions on how to solve this error?

Thanks
-Mark


Dec 26 '06 #2

P: n/a

"Larry Linson" <bo*****@localhost.notwrote:
The good news is that, unless you took specific action to remove it, the
event code was not deleted along with the Forms.
Before deleting the forms from the working database, I opend the VB
IDE and deleted all of the code for the forms in question. This was
to ensure that the event code didn't inadvertently stay around after I
deleted the forms.
But when you copied the Forms from your backup database, the code did not
come along with them.
The event code did come along with the forms from the backup database.
The bad news is, if it was something in your event code that was the
problem, you will still have it when you restore, but if you do, you have
valuable debug information from that fact.
The backup database and its code all work fine, but it contains none of
the changes that I want to keep from the working copy (db schema
changes, and some changes to module code.)
All you will have to do, most likely, is to determine which events had
event code, and select "Event Procedure" for that Event in the Form's
Properties.
I tried removing all the event procedure code to a text file, then restoring
it one procedure at a time and testing at each step. This seemed to work
fine until the dreaded error inexplicably spread to another form that had
not been affected before. Now it's _really_ broken.

Dec 26 '06 #3

P: n/a

"Larry Linson" <bo*****@localhost.notwrote:
The good news is that, unless you took specific action to remove it, the
event code was not deleted along with the Forms.
Before deleting the forms from the working database, I opend the VB
IDE and deleted all of the code for the forms in question. This was
to ensure that the event code didn't inadvertently stay around after I
deleted the forms.
But when you copied the Forms from your backup database, the code did not
come along with them.
The event code did come along with the forms from the backup database.
The bad news is, if it was something in your event code that was the
problem, you will still have it when you restore, but if you do, you have
valuable debug information from that fact.
The backup database and its code all work fine, but it contains none of
the changes that I want to keep from the working copy (db schema
changes, and some changes to module code.)
All you will have to do, most likely, is to determine which events had
event code, and select "Event Procedure" for that Event in the Form's
Properties.
I tried removing all the event procedure code to a text file, then restoring
it one procedure at a time and testing at each step. This seemed to work
fine until the dreaded error inexplicably spread to another form that had
not been affected before. Now it's _really_ broken.

Dec 26 '06 #4

P: n/a
Mark wrote:
Good morning.

I recently made some changes to my Access project, and I introduced
some problems that I could not resolve. So I deleted the forms that I had
altered and saved the project. Then I opened my backup copy of
the project, and exported the affected forms to the working copy.

Now when I invoke any event procedures in the affected forms,
I receive the following error (this example is for a click event):

"The expression On Click you entered as the event property setting
produced the following error: User-defined type not defined."

I have extensively reworked the database in my working copy,
so I will lose all of that work if I simply roll back to my backup
copy.

Any suggestions on how to solve this error?

Thanks
-Mark
Before I did any of this I would be sure I had made a couple of safety
copies of the db. (I always make two or more because I'm often careless
about these things and find that one is actually my grocery list).

The first two things I would try are:

1. be sure that
Option Explicit is stated at the top of all modules: standard modules;
form modules; report modules and class modules.
then
2. while you have a standard module open, click on the menu bar, Debug
and then Compile.

This may bring up a simple error such as
Dim strLastName as sting
or Cancel as Intger

such errors can come from replaces which are not carefully planned.

but before I did any of this I would be sure I had made a couple of
safety copies of the db.

If this got me nowhere and the occurrence of the error gave me no clue
as to location or cause I would try
SaveasText acForm, "FormName", "FormName" & ".txt"
LoadFromText acForm, "FormName", "FormName" & ".txt"
Kill "FormName" & ".txt"
for every form, beginning with the most suspect.
In most cases, LoadFromText will fail if there is an error in the
form's module. This may identify for you the errant form, if there is
an errant form.

but before I did any of this I would be sure I had made a couple of
safety copies of the db.

If this still got me nowhere I might try posting the text file of the
most likely bad form here, or I might begin a new db and import each
object individiually until one gave me a problem.

but before I did any of this I would be sure I had made a couple of
safety copies of the db.

If none of those worked I would come back and ask, "What now?"

but before I did any of this I would be sure I had made a couple of
saftey copies of the db.

By Acces project do you mean Access project or do you mean "Access Data
Project" (ADP)?

DId I mention "Before I did any of this I would be sure I had made a
couple of safety copies of the db?"

Dec 26 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.