I have a form with an option that runs queries to filter the view. Case 3 asks for information from the user [TechnicianName]. If the tech's name is provided everything works fine. However, if the user cancels the msgbox then I get a 2101 error. I tried trapping the error but this too was unsuccessful.
On Error GoTo Error_Handler
Select Case Frame364
Case 1: 'Open
RecordSource = "qryPCSTrackerOpen"
Case 2: 'Closed
RecordSource = "qryPCSTrackerClosed"
Case 3: 'Tech
RecordSource = "qryPCSTrackerTech"
Case Else: 'Default case to trap any errors.
'Do nothing
End Select
Error_Handler_Exit:
On Error Resume Next
Exit Sub
Error_Handler:
MsgBox Err.Description
Resume Error_Handler_Exit
===================
Error_Handler:
If Err.Number=2101 Then
'ignore or message
Else
MsgBox Err.Description
End If
On Error GoTo Error_Handler
Select Case Frame364
Case 1: 'Open
RecordSource = "qryPCSTrackerOpen"
Case 2: 'Closed
RecordSource = "qryPCSTrackerClosed"
Case 3: 'Tech
RecordSource = "qryPCSTrackerTech"
Case Else: 'Default case to trap any errors.
'Do nothing
End Select
Error_Handler_Exit:
On Error Resume Next
Exit Sub
Error_Handler:
MsgBox Err.Description
Resume Error_Handler_Exit
===================
Error_Handler:
If Err.Number=2101 Then
'ignore or message
Else
MsgBox Err.Description
End If