Triscuit
Registered User.
- Local time
- Today, 15:00
- Joined
- Jul 20, 2010
- Messages
- 27
I've looked up a lot of error handling code and used the same error handling code in other areas of my project but this one ignores the "On Error" and still gives me the runtime error. Why?
This code handles simple Calendar control and i'm using it with a subform control. As a workaround I'm error handling the error and using my workaround for the subform.
This code handles simple Calendar control and i'm using it with a subform control. As a workaround I'm error handling the error and using my workaround for the subform.
Code:
Private Sub ocxCalendar_Click()
On Error GoTo Err_subForm
cboOriginator.Value = ocxCalendar.Value
cboOriginator.SetFocus
ocxCalendar.Visible = False
Set cboOriginator = Nothing
Exit_subForm:
Exit Sub
Err_subForm:
Select Case Err.Number
Case 91
Me.subfrmCalibrationAvgResponse.Form!dateLot.Value = ocxCalendar.Value
ocxCalendar.Visible = False
Set cboOriginator = Nothing
Me.subfrmCalibrationAvgResponse.Form!dateLot.SetFocus
Resume Exit_subForm
Case Else
Resume Exit_subForm
End Select
End Sub