I have code that works that is
With ClientForm
If retainerFee <> .RetainerFeeTB.Value Then
LabelLB.AddItem (.RetainerFeeLabel.Caption)
BeforeLB.AddItem (retainerFee) 'variable Value
AfterLB.AddItem (.RetainerFeeTB) 'Textbox.value
End If
If less250 <> .Less250TB.Value Then
LabelLB.AddItem (.less250label.caption)
BeforeLB.AddItem (less250) 'variable Value
AfterLB.AddItem (.Less250TB) 'Textbox.value
End If
end with
but I'd like to make it so I don't need to writer the code for every variable that needs to be called
and this is what I have so far for that
With ClientForm
For Each ctrl In .ClientMP.Pages(page).Controls
If TypeName(ctrl) = "TextBox" Or TypeName(ctrl) = "ComboBox" Then
variableName = Left(ctrl.Name, Len(ctrl.Name) - 2)
variableValue = ??variableName??
tBValue = ctrl.Value
If tBValue <> variableValue Then
labelName = variableName & "Label"
labelCaption = .Controls(labelName).Caption
LabelLB.AddItem (labelCaption)
BeforeLB.AddItem (variableValue)
AfterLB.AddItem (tBValue)
End If
End If
Next
End with
I just don't know how to get the Variable Value
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…