Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 ADP - what field has changed on current record?

Author  Topic 

Mathias
Posting Yak Master

119 Posts

Posted - 2002-05-06 : 03:40:08
How to know what field has changed on the current record before saving it?


Should I place code in OnCurrent and copy all variables to a Array of variant?

I am using Access 2000, APD and SQL 2000 server.
Paul

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-05-06 : 08:05:51
You can loop through all of the controls on the form and compare the Value and OriginalValue properties, and/or the Dirty property. These will tell you if the control's value has changed.

Go to Top of Page

Mathias
Posting Yak Master

119 Posts

Posted - 2002-05-06 : 10:38:55
This is exactly what I intend to do but there is no dirty property for a text box (linked to a field) or a value2. How do I get it?

Go to Top of Page

Mathias
Posting Yak Master

119 Posts

Posted - 2002-05-06 : 10:48:11
Dim ctlC As Control
' For each control.
For Each ctlC In Me.Controls
With ctlC
If .ControlType = acTextBox Then
If .OldValue <> .Value Then MsgBox "Old:" & .OldValue & "new :" & .Value
End If
End With
Next ctlC

I found it, I just have an issue left with the autocreated fields.

Go to Top of Page
   

- Advertisement -