PC Review


Reply
Thread Tools Rate Thread

Checking to see if a record has changed

 
 
=?Utf-8?B?SWFu?=
Guest
Posts: n/a
 
      16th Feb 2005
I am trying to see whether the data in a record on a form has been changed by
a user. Any Ideas

I was trying to concatinate all the data from each field together into a
single string when you open the record, and compare this to the concatinated
string of all the data when you leave the record. I was trying to use the
following statement to concatinate the data...

DIM i AS String

FOR EACH TEXTBOX IN FORM

i = i & TEXTBOX.VALUE

NEXT

....But it didn't work - Any Suggestions will be appriciated. thanks
 
Reply With Quote
 
 
 
 
Roger Carlson
Guest
Posts: n/a
 
      16th Feb 2005
I would create an audit function that would record any change to the
database. Information included would be: the table, the field, the old
value, the new value, and the user.

On my website (www.rogersaccesslibrary.com) there is a small sample database
called: "AuditTrail.mdb" which should get you started.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

"Ian" <(E-Mail Removed)> wrote in message
news:CF249F6D-9FCA-45A5-9014-(E-Mail Removed)...
> I am trying to see whether the data in a record on a form has been changed

by
> a user. Any Ideas
>
> I was trying to concatinate all the data from each field together into a
> single string when you open the record, and compare this to the

concatinated
> string of all the data when you leave the record. I was trying to use the
> following statement to concatinate the data...
>
> DIM i AS String
>
> FOR EACH TEXTBOX IN FORM
>
> i = i & TEXTBOX.VALUE
>
> NEXT
>
> ...But it didn't work - Any Suggestions will be appriciated. thanks



 
Reply With Quote
 
Roger Carlson
Guest
Posts: n/a
 
      16th Feb 2005
Oh. Allen Browne also has a sample which you can find here:
http://members.iinet.net.au/~allenbrowne/tips.html

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

"Ian" <(E-Mail Removed)> wrote in message
news:CF249F6D-9FCA-45A5-9014-(E-Mail Removed)...
> I am trying to see whether the data in a record on a form has been changed

by
> a user. Any Ideas
>
> I was trying to concatinate all the data from each field together into a
> single string when you open the record, and compare this to the

concatinated
> string of all the data when you leave the record. I was trying to use the
> following statement to concatinate the data...
>
> DIM i AS String
>
> FOR EACH TEXTBOX IN FORM
>
> i = i & TEXTBOX.VALUE
>
> NEXT
>
> ...But it didn't work - Any Suggestions will be appriciated. thanks



 
Reply With Quote
 
Tim Ferguson
Guest
Posts: n/a
 
      16th Feb 2005
=?Utf-8?B?SWFu?= <(E-Mail Removed)> wrote in
news:CF249F6D-9FCA-45A5-9014-(E-Mail Removed):

> I am trying to see whether the data in a record on a form has been
> changed by a user. Any Ideas


If Me.Dirty Then
MsgBox "You've edited the data!!"

Else
MsgBox "What, you just looking or are you buying?"

End If



HTH


Tim F

 
Reply With Quote
 
George Nicholson
Guest
Posts: n/a
 
      16th Feb 2005


--
George Nicholson

Remove 'Junk' from return address.
"Ian" <(E-Mail Removed)> wrote in message
news:CF249F6D-9FCA-45A5-9014-(E-Mail Removed)...
>I am trying to see whether the data in a record on a form has been changed
>by
> a user. Any Ideas
>
> I was trying to concatinate all the data from each field together into a
> single string when you open the record, and compare this to the
> concatinated
> string of all the data when you leave the record. I was trying to use the
> following statement to concatinate the data...
>
> DIM i AS String
>
> FOR EACH TEXTBOX IN FORM


Try:
Dim strTemp as String
Dim ctl as Control

For Each ctl in Me.Controls
If ctl.ControlType = acTextBox then
strTemp = strTemp & ctl.VALUE
End If
Next ctl

("Me" refers to the form who's code module contains this code)

>
> i = i & TEXTBOX.VALUE
>
> NEXT
>
> ...But it didn't work - Any Suggestions will be appriciated. thanks



 
Reply With Quote
 
David C. Holley
Guest
Posts: n/a
 
      17th Feb 2005
Read up on the the onDirty event. The event triggers (if memory serves)
when any field value is changed - even down to a single letter.

Ian wrote:
> I am trying to see whether the data in a record on a form has been changed by
> a user. Any Ideas
>
> I was trying to concatinate all the data from each field together into a
> single string when you open the record, and compare this to the concatinated
> string of all the data when you leave the record. I was trying to use the
> following statement to concatinate the data...
>
> DIM i AS String
>
> FOR EACH TEXTBOX IN FORM
>
> i = i & TEXTBOX.VALUE
>
> NEXT
>
> ...But it didn't work - Any Suggestions will be appriciated. thanks

 
Reply With Quote
 
Troy
Guest
Posts: n/a
 
      17th Feb 2005
If me.Dirty = True Then 'Form data has changed.

You need to check this in the BeforeUpdate even of the form and act on it
appropriately.

--
Troy

Troy Munford
Development Operations Manager
FMS, Inc.
www.fmsinc.com


"Ian" <(E-Mail Removed)> wrote in message
news:CF249F6D-9FCA-45A5-9014-(E-Mail Removed)...
I am trying to see whether the data in a record on a form has been changed
by
a user. Any Ideas

I was trying to concatinate all the data from each field together into a
single string when you open the record, and compare this to the concatinated
string of all the data when you leave the record. I was trying to use the
following statement to concatinate the data...

DIM i AS String

FOR EACH TEXTBOX IN FORM

i = i & TEXTBOX.VALUE

NEXT

....But it didn't work - Any Suggestions will be appriciated. thanks


 
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 value changed John Microsoft Access 1 5th Nov 2008 07:54 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 which fields changed John Microsoft Access Forms 2 9th May 2007 10:01 PM
Q: checking if a row item has changed G .Net Microsoft VB .NET 0 27th Oct 2006 10:30 AM


Features
 

Advertising
 

Newsgroups
 


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