If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Checking for value changed
Hi
When a user has modified a text box how can I check if the value has actually been changed form what it was and the value is not null or empty? Thanks Regards |
#2
|
|||
|
|||
Checking for value changed
Until the record is saved, you can compare the Value of a control to its
OldValue. This example tests whether a control changed at the last possible moment before the record is saved: Private Sub Form_BeforeUpdate(Cancel As Integer) With Me.[YourControlNameHere] If (.Value = .OldValue) OR (IsNull(.Value) AND IsNull(.OldValue)) Then Debug.Print "unchanged" Else Debug.Print "Changed from " & .OldValue & " to " & .Value End If End With End Sub -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "John" wrote in message ... When a user has modified a text box how can I check if the value has actually been changed form what it was and the value is not null or empty? |
Thread Tools | |
Display Modes | |
|
|