I accidentally erased all of the VBA code for one of my forms.
That is okay. I have a backup of the db with that form included.
Now I know that I cannot just do a wholesale copy of the form's VBA code
since many of the subprograms are associated with a button on the form.
That cannot be ignored.
So I just find a button on the codeless form, then go to
design view and press f4. That will bring up the properties of the button
and immediately tell me (when pressing the event tab) whether or not
the button has VBA code associated with it. Then decide on action and
get the first and last lines of VBA code for the button; then go to the backup db get the
complete code for that button and copy and paste into the existing db right
at the point where the two lines (first and last) are located.
Then with a little editing and you have got it. The VBA code is associated with that button.
That works most of the time.
However, in the backup db on the form discussed I have noticed that the are some sub programs
in VBA code that do not seem to obviously have a button associated with them.
It is easy to find the VBA code associated with the button, but how do you find the button
associated with the VBA code? That is the reverse.
I just have some orphan sub programs whose names end in click that I assume are associated
with a button. I just need to find that button.
How do I do it?
Any help appreciated. Thanks in advance.
Respectfully,
Lou Reed