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!

Lock a record from code.

Status
Not open for further replies.

Larsson

Programmer
Jan 31, 2002
140
SE
Hi!

I have an interesting problem. I have created a form with unbound controls. In these controls I load data from a table. The thing is that I want to lock the record in the table for two minutes. So the user has two minutes to change the data, before they need to update it again.

I want to better control when data is updated and to hinder the user from accidentally change the record.

But the system is a multi-user system and therefore I have to lock the record a short time.

So how do I lock a record in a table from VB? And then unlock it?

I have some other ideas if this doesn’t work, but this way is the best way.
Larsson
 
Why don't you just create a bound form that keeps the record lock, but have the form closed after 2 minutes?

That should do it.

B ----------------------------------------
Ben O'Hara
Home: bpo@SickOfSpam.RobotParade.co.uk
Work: bo104@SickOfSpam.westyorkshire.pnn.police.uk
(in case you've not worked it out get rid of Sick Of Spam to mail me!)
Web: ----------------------------------------
 
I tried that but the record doesn't get locked.
And the form needs to continue to be open. I just disable some buttons.

Larsson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top