Sabotage
Board Regular
- Joined
- Sep 19, 2013
- Messages
- 58
Hi Wizzards!
I have a problem not being able to trigger my error handler after the code is trying to set an "empty list" for combobox rowsource. In a nutshell my code is trying to set the rowsource for a combobox, depending on a value in another combobox's value. I have tried to put "On Error GoTo Err1" where Err1 is my Error Handler. Tried to put it before Select Case and inside Select Case but no luck what so ever. My Error Handler would just tell the user that the specified supplier does not have any store location set and exit the procedure. The user hence will know what is wrong...
Thank you in advance!
I have a problem not being able to trigger my error handler after the code is trying to set an "empty list" for combobox rowsource. In a nutshell my code is trying to set the rowsource for a combobox, depending on a value in another combobox's value. I have tried to put "On Error GoTo Err1" where Err1 is my Error Handler. Tried to put it before Select Case and inside Select Case but no luck what so ever. My Error Handler would just tell the user that the specified supplier does not have any store location set and exit the procedure. The user hence will know what is wrong...
Thank you in advance!
Code:
Select Case cb_Supplier
Case "Supplier ABC"
On Error GoTo Err1
cb_StoreName.RowSource = "SupLoc_ABC" 'error occurs
On Error GoTo 0
Case "Supplier XYZ"
On Error GoTo Err1
cb_StoreName.RowSource = "SupLoc_XYZ" 'error occurs
On Error GoTo 0
End Select