Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine if any data on form has been modified

Status
Not open for further replies.

jswe

MIS
Dec 30, 2003
8
US
I have a form bound to a table - I want to stamp a date in the form/table if any of the data is modified on the form. I have a lot of controls on the form and do not want to put an On Update action on each control. I do not want to use an Unload event on the form because I do not want a date stamped if the user is just viewing the form. Is there a way to do this?
 
Hi!

The before update event of the form triggers anytime something is saved for a record. Think that might be used.

Roy-Vidar
 
You could create a module-level string and assign all the default values to it on Form Load.

Then, on Form Unload, dim another string, assign all the default values to it; then compare the two strings. If they're different, something changed so you'd use your date stamp.

< M!ke >
 
How are ya jswe . . . .

Yes! Look to the forms Dirty property! I believe its only available at run time, so your gonna have to look in VBA help for it . . . .

TheAceMan [wiggle]

 
Use the OnDirty command for the Form

Private Sub Form_Dirty(Cancel As Integer)

TextField = Now()

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top