I get an error message in VBA saying Object Variable or With Block Variable Not set whenever I try to close the form.
It highlights the line I have commented in green in the code below. I just commented it right now so you can see it. It's not commented out when I run the program.
The code below is for an ActiveX I created with vb 6.0 which prevents the user from using the scroll button on the mouse to move through records. When they try to use the scroll button they get a pop up that says sorry you can scroll through records using the mouse scroll.
Anyways, I used this exact coding and ActiveX I created in a previous program and it worked fine with no error pop-ups. However, in this new program it's giving me that error.
VB Code:
Private Sub Form_Close() On Error GoTo Err_Form_Close 'clsMouseWheel.SubClassUnHookForm Set clsMouseWheel.Form = Nothing Set clsMouseWheel = Nothing Exit_Form_Close: Exit Sub Err_Form_Close: MsgBox Err.Description Resume Exit_Form_Close End Sub




Reply With Quote