[vba]
Option Explicit
Private fByPass As Boolean
Private Sub cboAccMap_Change()
If Not fByPass Then
fByPass = True
'error handling
On Error GoTo Err_cboAccMap_Change
'freeze the screen
Application.ScreenUpdating = False
With Me
'reset the other combobox
Me.cboControlMap.ListIndex = -1
'lookup the value selected to return the debit and credit maps
.txtDebitMap.Value = Worksheets("AccNum").Range("C" & .cboAccMap.ListIndex + 2).Value
.txtCreditMap.Value = Worksheets("AccNum").Range("D" & .cboAccMap.ListIndex + 2).Value
End With
'unfreeze the screen
Application.ScreenUpdating = True
fByPass = False
'exit the proc
Exit Sub
End If
'error handling
Exit_cboAccMap_Change:
Exit Sub
Err_cboAccMap_Change:
MsgBox "The following error occurred " & Err.Number & Err.Description
Resume Exit_cboAccMap_Change
End Sub
Private Sub cboControlMap_Change()
If Not fByPass Then
fByPass = True
'error handling
On Error GoTo Err_cboControlMap_Change
'freeze the screen
Application.ScreenUpdating = False
With Me
'reset the other combobox
Me.cboAccMap.ListIndex = -1
'lookup the value selected to return the debit and credit maps
.txtDebitMap.Value = Worksheets("ControlMemo").Range("B" & .cboControlMap.ListIndex + 2).Value
.txtCreditMap.Value = Worksheets("ControlMemo").Range("C" & .cboControlMap.ListIndex + 2).Value
End With
'unfreeze the screen
Application.ScreenUpdating = True
fByPass = False
'exit the proc
Exit Sub
End If
'error handling
Exit_cboControlMap_Change:
Exit Sub
Err_cboControlMap_Change:
MsgBox "The following error occurred " & Err.Number & Err.Description
Resume Exit_cboControlMap_Change
End Sub
[/vba]