Record Locking Multiusers Over Network Split Database, Access 2007 (1 Viewer)

skoolz

Registered User.
Local time
Yesterday, 20:57
Joined
Jun 26, 2015
Messages
32
Hi all,

I have designed a database which I intend to split for multi-users to access from one front end icon on a shared folder at work. I have designed a form bound to cmr record table and on it a subform to another table where cmrs activities will be saved. The form has buttons to and blank controls.
User can create a new activity entry by typing into the blank controls and pressing the save button which saves to the activity table. the edit button extracts a selected records details (selected on the subform) from the activity table and populates the blank field for a user to edit and then hit save to save changes. The delete button deletes a selected record from the activity table. I intend to have multi-users either accessing, viewing and a possibly editing the same customer at the same time. The simultaneous viewing is essential but the simultaneous editing, though not desired is inevitably going to occur.

What I would like to know is:

1. Can you lock an individual record in a table or does the whole table have to be locked.
E.g If Colleague 1 is editing Cmr A's record in Table1 can he lock it so Colleague 2 can view and edit Cmr B's record in Table1

2.Can Colleague 1 access/read Cmr A's record in Table1 to retrieve details toe the form controls if Colleague 2 is viewing or editing Cmr A's record in Table1

3. If record lock is possible, how can I initiate it in my example code below

Edit activity record Code
Code:
Private Sub Edit_A_Click()

'Get Data to text box control
        With Me.R_P_Data_P_Subfrm.Form
            Me.txtrID = !rID
            Me.txtrID.Tag = !rID
            Me.txtrefNo = !refNo
            Me.cmbrpc = !rPC
                   etc....

New activity record entry
Code:
CurrentDb.Execute "INSERT INTO R_P_Data_P (appNoSys,appNo,refNo       etc....     ) " & _
            " Values ('" & Me.appNosys & "','" & Me.txtApplNo & "','" & Me.txtrefNo & "');"

Update activity record
Code:
CurrentDb.Execute "Update R_P_Data_P " & _
                          "Set refNo=" & Me.txtrefNo & _
                          ", rpc='" & Me.cmbrpc & "'" & _
                          ", srpc='" & Me.cmbsubrpc & "'" & _
                                               etc.....
                          " WHERE rID=" & Me.txtrID.Tag

All advice welcome and appreciated

Thanks!
 

spikepl

Eledittingent Beliped
Local time
Today, 05:57
Joined
Nov 3, 2010
Messages
6,142
multi-users to access from one front end icon on a shared folder at work.

If you plan on users all accessing the same piece of code then you are asking for trouble. Further, since everything is run locally, placing code on some shared drive just places even more load on the network.

You want to serve yourself using record locking, but you threw away the option of using the built-in Access-mechanisms by using unbound forms. So you have to build your own mechanism, and also make sure locks are not permanent in case of a crash.

Why do you use unbound forms?
 

skoolz

Registered User.
Local time
Yesterday, 20:57
Joined
Jun 26, 2015
Messages
32
spikepl, I used unbound forms to create a user friendly and intuitive UI and use cascading combo box selections and validation....

any suggestions or steer on how to create such a locking mechanisms?
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 04:57
Joined
Sep 12, 2006
Messages
15,652
do you have another thread on this? or is it on UA? I am sure I replied to this post.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 11:57
Joined
May 7, 2009
Messages
19,233
its doable, but did you consider lock-out situation, when the other person want to edit that record and you are also has the record locked but on the meantime out of office doing some rush jobs.
 

spikepl

Eledittingent Beliped
Local time
Today, 05:57
Joined
Nov 3, 2010
Messages
6,142
I used unbound forms to create a user friendly and intuitive UI
´

Explain relation between "unbound" and "user friendly and intuitive" - which is only obvious to you, so far.

This type of argument has been seen before and is often caused by lack of clarity about how Access works by itself, and that what happens in bound forms can be controlled (which it CAN!).

Update:

You have not clarified what users run (not a great idea) from the server: each his own code on server or do you think you can run one piece of code for all of them?
 

spikepl

Eledittingent Beliped
Local time
Today, 05:57
Joined
Nov 3, 2010
Messages
6,142
This is double posted on ua.

Bye bye I'm gone.
 

skoolz

Registered User.
Local time
Yesterday, 20:57
Joined
Jun 26, 2015
Messages
32
spikepl, It is true that I'm a novice in Access hence why I was seeking expert advice and guidance on my flawed design.

Thanks Gemma, I did initially post on UA due to low response I posted here and wasn't aware the two separate forums sites are one.

arnelgp thanks for your advice, much appreciated.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 04:57
Joined
Sep 12, 2006
Messages
15,652
spikepl, It is true that I'm a novice in Access hence why I was seeking expert advice and guidance on my flawed design.

Thanks Gemma, I did initially post on UA due to low response I posted here and wasn't aware the two separate forums sites are one.

arnelgp thanks for your advice, much appreciated.

AWF (this) and UA aren't the same forum, but often posters put similar requests on both. Hence I recollected having seen a similar post.
 

Users who are viewing this thread

Top Bottom