Thank you Andy and tehneXus
I have changed tehneXus' code to use the .Tag property and not the .Name property (see the changed code below):
strMsg = "You are about to change the Expense Category Codes and/or the Reference Number." & vbCr & vbCr _
& "The New values are:" & vbCr
For Each ctrl In Me.Controls
If TypeName(ctrl) = "ComboBox" Then
If ctrl.Enabled Then
strMsg = strMsg & vbCr & ctrl.Tag & " :" & Space(40 - Len(ctrl.Tag)) & ctrl.Value
End If
End If
Next ctrl
Confirm = MsgBox(strMsg & vbCr _
& RefNoLabel & " :" & Space(40 - Len(RefNoLabel)) & RefNoTextBox.Value & vbCr & vbCr _
& "Is this correct?", vbYesNo, "Confirm Change")
I am setting the Tag property when the form is Initialized, i.e.
Me.ExpCat1ComboBox.Tag = Sheet3.Range("B10").Value
Thank you for your help.
Bookmarks