My Access program has developed a problem when a particular form is switched to Design View from Form View. I get an "MS Access has Stopped Working" error message (this occurring only when the program is run under Office 2013; 2010 works with no issues). I have narrowed it down to some VBA code, which, if eliminated, removes the problem. The code is (as part of a larger Class Module):
By trial and error, I have found that commenting out the "Set cTextBox = c" statement removes the problem (I then get a VBA error message, not surprisingly I guess, but the Access Stopped Working error is gone).
I didn't write the code and I'm not sure what it is doing but it appears Access 2013 doesn't like it for some reason. Could someone please offer a suggestion as to how to get this to work with 2013?
TIA for any help...
Code:
Public Property Set ControlSetting(ByVal c As Control)
Select Case c.ControlType
Case acTextBox
Set cTextBox = c
cTextBox.OnEnter = "[Event Procedure]"
cTextBox.OnLostFocus = "[Event Procedure]"
End Select
End Property
By trial and error, I have found that commenting out the "Set cTextBox = c" statement removes the problem (I then get a VBA error message, not surprisingly I guess, but the Access Stopped Working error is gone).
I didn't write the code and I'm not sure what it is doing but it appears Access 2013 doesn't like it for some reason. Could someone please offer a suggestion as to how to get this to work with 2013?
TIA for any help...