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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checing for Change with Unbound Form

Status
Not open for further replies.

grnzbra

Programmer
Mar 12, 2002
1,273
US
I am building a database which uses unbound forms. The model that I'm using of the SaveUpdates procedure has a commented line "Check here for changes by other users".

My solution to this is to have each involved table have an UpdatedBy field and code which sets this to Now() & UserName whenever a change is made. When the record is first loaded, this value is loaded into a hidden field. Then the SaveUpdates procedure is run, I first check this field matches the value in the hold field. If it does, the prcedure continues to update the record. If it doesn't, the standard "Somebody else just changed it. What do you want to do now?" message is displayed.

I'd like to know if this is the "official" way to do something like this or is there some "changed" property that records have that is normally checked?
 
I would expect that with everyone's copy of the form flopping around in the breeze, a change made by one person would not cause a change in another person's form's dirty property.
 
The dirty property does not work on unbound forms.

You'll need to create your own routines to check the values against the table for changes.

It would probably be easier to create your own record-locking code to prevent other users making changes whilst user A has the record open.

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top