Hi Guys,
I am having a little problem with making an audit trail for a form with some unbound text controls on it and wondered if you could point me in the right direction.
Since .OldValue won't work on unbound text boxes, google suggested that I put the old value in the control's tag property. This is what I came up with:
The first loop is supposed to dynamically assign the tag value, with whatever the textbox value is, however it doesn't :lol: I've asterixed out the line i think may be the issue, but could someone provide a hint please?
Thanks in advance
I am having a little problem with making an audit trail for a form with some unbound text controls on it and wondered if you could point me in the right direction.
Since .OldValue won't work on unbound text boxes, google suggested that I put the old value in the control's tag property. This is what I came up with:
Code:
Dim ctl, tbox As Control
Dim strName, strOLD, StrNew, NewTag As String
Dim NextOne As Label
For Each tbox In Me.Controls
If TypeName(tbox) = "TextBox" Then
Select Case tbox.Value
Case Nz(tbox.Value) > 0
Case Else
''''''''''''''''''''''''''''''''''''''''''''''''''
' NewTag = Nz(tbox.Value)
' tbox.Properties("Tag") = NewTag
''''''''''''''''''''''''''''''''''''''''''''''''''
End Select
End If
Next tbox
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then
Select Case ctl.Value
Case Nz(ctl.Value) > 0
Case Else
strName = Nz(ctl.Name)
strOLD = Nz(NewTag)
StrNew = Nz(ctl.Value)
If strOLD <> StrNew Then
MsgBox (strOLD & " " & StrNew)
Else
End If
End Select
End If
Next ctl
End Sub
The first loop is supposed to dynamically assign the tag value, with whatever the textbox value is, however it doesn't :lol: I've asterixed out the line i think may be the issue, but could someone provide a hint please?
Thanks in advance