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

Proper way to regulate access to records in linked tables?

Status
Not open for further replies.

mpruett

Programmer
Jul 22, 2005
13
0
0
US
Ok... here's my situation.

I have an mdb with my data on our server. I may have up to at least 10 users updating the data on that mdb.

For whatever reason, management wants this thing to go in one direction, so what I have is a button to go to the next record when the editing is done.

What I want to do is have my "Updated" flag updated on entry into the record, and have the other users' front-ends see that and not grab the record I'm working on.

I'm assuming that I need to do something like "Me.updated = 1", and some kind of save & requery on each next or each entry into the form, to make sure I don't grab anyone else's records.

Can someone give me some pointers as to what events and functions I should use?

Thanks,

Mark
 
I'm not clear on your requirements. If you want people to only be able to add records (not edit them) you can simply set the DataEntry property of your form to True.

If you are saying that people can only edit the records they created, then you will need a field that you store the user's identity. In the forms you would have the queries filter by the user against this field.

 
mpruett

You have a recordset that it is available concarently to all users and you want the next record that shows up to your user when he clicks the "Next" button is one that is not currently viewed by noone else. The difficulty of this is how fast is written to the database a flag that the next record is viewed by user1 and so user2 wont see it.

An example of real time:
User1 sees record R1 and its flag of been seen is on
User2 sees record R2 and its flag of been seen is on
User1 clicks next, you have to requery the recordset for flags off, then set the first returned (R3) record' s flag on and then show the record. When user1 clicks next so does user2. He might get his correct "Next" record (R4). But you said you have 10 users....

Would it be ok to open that recordset and show to your 1st user the first record, 2nd user 2nd record and so on? You could use the AbsolutePosition in a dynaset- or snapshot-type Recordset or use a ranking query to make this kind of linking.
But if durring work time the records are deleted or not for viewing any more and a user reopenns the form, then this wont work properly.

Another trick could be to assign certain characteristics of a record to certain users. If there is a branchID or a regionId or something similar

Just my 2cents
 
Remou

Record locking happens when you begin editing data. But what OP says "grab the record I'm working on" sounds like "see-select the record I'm working on".
mpruett, would you clarify this?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top