Here is the complete code for the form in the DB post #23.
It wasn't clear how the OP's "trouble shooting" code snippet would be used (perhaps OP meant "Error Handler code"), so I just included it in a sub named "TroubleShoot" and called it from within a couple of the indicated events.
Code:
Option Compare Database
Option Explicit
Private Sub cboCategory_AfterUpdate()
On Error GoTo cboCategory_AfterUpdate_Error
Dim sSource As String
sSource = "SELECT [subCATEGORIES].[SubCategoryID], [subCATEGORIES].[CategoryID], [subCATEGORIES].[subCAT] " & _
"FROM subCATEGORIES " & "WHERE [CategoryID] = " & Me.cboCategory
Me.cboSub.RowSource = sSource
Exit Sub
cboCategory_AfterUpdate_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure cboCategory_AfterUpdate, line " & Erl & "."
End Sub
Private Sub cboSub_AfterUpdate()
On Error GoTo cboSub_AfterUpdate_Error
Me.subCATEGORY = Me.cboSub.Column(2)
Exit Sub
cboSub_AfterUpdate_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure cboSub_AfterUpdate, line " & Erl & "."
End Sub
Private Sub TroubleShoot()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to continue?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Title = "MsgBox Demonstration"
Help = "DEMO.HLP"
Ctxt = 1000
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
MyString = "Yes"
' Perform some action.
Else ' User chose No.
MyString = "No" ' Perform some action below.
GoTo Exit_bail:
End If
Exit_bail:
Exit Sub
Err__testing:
MsgBox Err.Description
' Resume COMBOcatTP_AfterUpdate
GoTo Exit_bail:
DoCmd.Close
DoCmd.OpenForm "originalresourceinputform"
' originalresourceinputform.show
'-----------------------------------------------------------------------
End Sub
Private Sub Description_Click()
Call TroubleShoot
End Sub
Private Sub Form_Current()
Call TroubleShoot
End Sub
Note to ZEVVER:
If this code is pasted into an existing DB's form, the form will know nothing of the new events introduced in the code.
You will need to ensure that for example, the Description_Click event exists on the form's property sheet, and clicking on the 3 dots will actually go to that event in the new code.