Issue importing form

smclellan

puffdaddy
Local time
Today, 07:10
Joined
Mar 12, 2007
Messages
12
Hey Everyone,

Don't know if this is a common issue or if I've just missed something obvious but when I try to import a form containing custom vba code none of my events seem to fire. I've tried putting breaks on all the event handlers but none of them seem to catch. In its original project the form worked fine but now nothing? If any one knows how this issue could be resolved that would be a great help. Thanks in advance
 
The events have probably been emininated on your form, even though the code still exists.

I've seen this happen when copying control from one form tab to another.
 
You dont happen to know of any solution other than replacing all my controls and placing the existing code in the new event handlers?
 
I assume all the code still exists, only the Access event are dropped.

Recreated the event links to the code.
 
By this do you mean go into the properties of the control, select Event, select On Click then click ... button ?, because according to the property theres still a link between the event for the control and the code.
 
Recreate the calls to the various VBA subroutines and functions. The code is still there, I presume.
 
Alright this is very strange. It seems that some of the buttons on my form still work as intended, but three buttons do not. I tried to recreate the link between the three buttons that dont work and their event handlers by going into properties, selecting the Events tab, select [Event Procedure] in the combobox beside On Click then clicking the ... button. When I do this it directs me back to the original event handler!? It seems like the link was never broke.

But the code still wont execute. I even tried creating a new button on the form and pasting the code in its event handler with no luck. Im starting to wonder if its the code thats causing the problem. Im sorry if my explanation makes no sense but your help is greatly appreciated. Thanks
 
Set a breakpoint on each event that does work and cause that event to fire and step through the event's code.
 
I've tried and the breakpoints dont break but yet they still execute the code... it makes no sense.
 
Try these commands from the immediate window:
saveastext acForm,"Form Name", "C:\frm.txt"

Rename your existing Form then run this command
loadfromtext acForm, "Form Name","C:\frm.txt".
 
Alright I think I've stumbled on the problem. I originally created the forms being imported in Access 2003 and its just occurred to me that the project I'm importing them into was created with Access 97. I have since imported the objects of both projects into a new database and everything works fine.

Sorry about the inconvience guys and thanks for all your help.
 
Sounds like you have a corruption problem. Create a new blank database and import all your objects and retry the above.
 

Users who are viewing this thread

Back
Top Bottom