Synchronizing Access Forms in a Multi-User Environment. (1 Viewer)

Colonel Mustard

New member
Local time
Today, 15:55
Joined
Dec 8, 2014
Messages
4
I am developing a small database for use in a multi-user environment: I have split the tables off and am testing with two copies of the front-end on different machines. All seems to work well except on one form.

On this form, the value of a bound control (exposed as a number of radio buttons) is used to make related controls on the form visible or invisible. I use the AfterUpdate event to trigger appropriate VBA code to accomplish this; it works well. However if two users have the same form open at the same record (unlikely, but not impossible), and User A changes the value of the control via the radio buttons, Access will eventually propagate the change to User B's copy of the form but the AfterUpdate event will not be triggered and the form becomes inconsistent. I understand that events are only triggered when a user makes a change to a control; how can I be alerted when Access makes a change?

I have scoured the internet with no luck. Can anybody help?
 

marlan

Registered User.
Local time
Today, 21:55
Joined
Jan 19, 2010
Messages
409
Hi,

First, I'm not sure user B's form will requery, unless it is requested to.
Second, And I'm not soure this is best practice, but it should work:
Forms have TimerInterval Property, and OnTimer event.
By default TimerInterval is 0, therefor OnTimer never occurs. However, if you want you can set TimerInterval to a number of milliseconds, and have OnTimer Event call the AfterUpdate Event to check and modify Controls.
You can also control when user B's form when is re-queried in this Ontimer Event.

Good luck!
 
Last edited:

Colonel Mustard

New member
Local time
Today, 15:55
Joined
Dec 8, 2014
Messages
4
Marlan:

Thanks for your prompt and helpful reply. I agree the solution you propose may not be optimal (I assume the TimerInterval continually fires), but in searching through the Form events, it seems the only solution. However, I'm surprised that this situation is not handled more elegantly by Access: making Form content dependent on controls in the same or parent forms is fairly standard.

Again thanks for your reply.

Colonel Mustard
 

MarkK

bit cruncher
Local time
Today, 12:55
Joined
Mar 17, 2004
Messages
8,178
Each user should have her own copy of the Front End program file. Don't set it up so two users open the same file at the same time.
 

Colonel Mustard

New member
Local time
Today, 15:55
Joined
Dec 8, 2014
Messages
4
MarkK and jdraw:

Thanks for your helpful comments. I did not make it clear that both User A and User B have their own copies of the front-end file; in fact they are running on separate machines. I will review the ideas from fmsinc.com to see if they might help.

Again your advice is greatly appreciated.

Colonel Mustard.
 

Colonel Mustard

New member
Local time
Today, 15:55
Joined
Dec 8, 2014
Messages
4
MarkK and jdraw:

Thanks for your helpful comments; I will review the ideas at fmsinc.com.

In my arrangement, both users have their own copies of the front-end; in fact the users are on separate computers. It seems that Access just propagates the changes to User B's form in my scenario rather than doing a Requery from the database; that I believe would have triggered the On_Current event and all would have been well. Pity!
 

Users who are viewing this thread

Top Bottom