Modify VBA with form open

speakers_86

Registered User.
Local time
Today, 06:50
Joined
May 17, 2007
Messages
1,919
Is it okay to change event procedures with the form in form view? Up to now, I've avoided this like the plague, but if there is no code running, I don't see how it would hurt. Do we have to be in design view while writing code?
 
I do it all the time when trying to get something to work, just have the VBA window open and off to the side so you can see both it and the form. Providing code isn't running you can edit it, then click the appropriate button or whatever action required to trigger the code
 
I avoid doing it too, but a client does it all the time and it doesn't seem to have affected him. I may be thinking of earlier versions where you could corrupt the object by modifying while open. Or I'm just paranoid. :p
 
I have even edited the code during a Break and have never had any problems.
 
I do this routinely. I'll put a button on a form, put a breakpoint in the code that the button runs, and edit that code while in break. No problem.

To me it's one of the things that makes VBA so easy to use, that you can do that edit and not have to kill the running code and re-compile.
 
Depending on the code you are adding you can do it.

The initial release of Access 2000 had bugs hat would corrupt your code. Pasting code with compiling o editing in brreak mode would oftern corrupt all the VBA code. It was fixed in the SP1. I know many, including myself that got bit by this and we learn to avoid it. I saw the same issue appear with the first release of Access 2007.

When you have multiple version of Access installed on the same Windows instance (side by side I have seen the VB editor have issues and corrupt all the VBA code when editing in break mode.

Before testing I will exit and backup the database. Only then will I edit VBA code in break-mode.

I have also had to use to use /decompile after someone did some VBA edit in break mode to get the code to function properly.
 

Users who are viewing this thread

Back
Top Bottom