Access crashing because of code!

Adam McReynolds

Registered User.
Local time
Today, 01:59
Joined
Aug 6, 2012
Messages
129
A coworker a while ago tested a code on our DB and I deleted the event but forgot to delete the code source in VBA. The weird thing is the system ran fine for months until my boss added a new button. The naming does not match in anyway so we do not know how this orphaned code ran. When we ran the debugger it showed us where the problem was but we are curious as to why when the button was added that it finally crashed. Any help would be awesome.

Here is the code my coworker put in:

Private Sub Combo387_BeforeUpdate(Cancel As Integer)
x = 1
Do
x
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
Loop Until x = Text390
End Sub


Here is the Macro to the button my boss put in (button name command187 for OpenReport):
rpt_Module_Repairs_TW_Study, Print Preview, , , Normal


My boss is nervous that we may have reached some sort of capacity for Access or VBA code?
 
Thanks for the suggestions! I will look into them and respond back with how they worked. Also, I will not post a duplicate thread in the future. Thanks again.
 

Users who are viewing this thread

Back
Top Bottom