473,513 Members | 13,099 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error after importing forms from backup copy of project

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
4 2230
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

"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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4329
by: Andante.in.Blue | last post by:
Our Access 97 database is a single-file (non-splitted, pure Access) hosted no a network server, accessed regularly by a handful of users around the office. Until recently (until the Great...
3
1728
by: Serious_Practitioner | last post by:
Hello, all - A few days ago, I posted the following message - Hello all, and thank you for your help in the recent past. Got a new error message in the last few days. While working with...
1
1360
by: Serious_Practitioner | last post by:
Good day - As you suggested, I got and used the right version of Jetcomp, and I also tried to run compact and repair a couple of times. I think that the compact and repair process doesn't fully...
4
5131
by: Brian K. | last post by:
I am trying to split up and secure a database that we've been using on a network for a few years, following the procedure listed in Q304932 from microsoft. I create a new blank database for...
1
114304
by: Alex D. | last post by:
I upgraded one of my applications to beta 2. conversion seemed to work OK, problem is when trying to build I get an error like: it is an error to use a section registered as...
9
2381
by: advance scout | last post by:
HELP! My database is suddenly corrupted. My computer was acting funny (very sluggish) and was shut down. Access had been already been closed down but computer was acting very slow , so perhaps it...
1
1334
by: GS | last post by:
when I try choose an image by importing a bmp file. I found the visual studio express creating a designer vile for my project. that is if my assembly name is myapp, I will find a new file...
0
3998
by: gunsbong | last post by:
hello again everybody.. i just copied the backup file from production to another server with the same config with the production...when i restore the copied backup file this message appears......
11
5556
by: xenoix | last post by:
hey there, im reasonably new to C# and im currently writing a backup application which im using as a learning resource. My PC :- Visual Studio 2005 .NET Framework 2 Component Factory Krypton...
0
7254
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.