PC Review


Reply
Thread Tools Rate Thread

Checking for value changed

 
 
John
Guest
Posts: n/a
 
      5th Nov 2008
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


 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      5th Nov 2008
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> 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?


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking for changed textboxes John Microsoft Access 1 12th Nov 2009 04:58 AM
Checking for value changed John Microsoft Access Forms 1 5th Nov 2008 07:54 AM
Checking which fields changed John Microsoft Access 2 9th May 2007 10:01 PM
Checking to see if a record has changed =?Utf-8?B?SWFu?= Microsoft Access VBA Modules 6 17th Feb 2005 02:28 PM
checking if text changed? dreamvigile Microsoft Excel Programming 3 27th May 2004 08:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:56 AM.