Auto Refresh (1 Viewer)

Gismo

Registered User.
Local time
Today, 02:32
Joined
Jun 12, 2017
Messages
1,298
Hi All,

This will most probably be a silly question and I most probably know how to do this but i just can not think of how to action it

I need to refresh a form when any of the data in the table is updated by other users
The data on the form is from a copy of the Data Table so the form does not reflect the current Data Table on the BE

if any of the data on the table changes, a macro needs to run automatically to update the new data and refresh the form

any ideas will be much appreciated
 

NauticalGent

Ignore List Poster Boy
Local time
Yesterday, 19:32
Joined
Apr 27, 2015
Messages
6,319
if any of the data on the table changes, a macro needs to run automatically to update the new data and refresh the form
Good morning....this method is not the best way to go....is there a reason you chose this method?
 

Isaac

Lifelong Learner
Local time
Yesterday, 16:32
Joined
Mar 14, 2017
Messages
8,774
I guess you could do something like this?

On the form where people will be editing data, in the AfterUpdate event, update a record in a table - the only record in that table - update [DateEdited] to now() and [DateNotified] to null.

On the form that needs refreshing or notification, run a timer event to check every minute or whatever.
Dlookup() DateNotified - if it's null, run your notification code, and then update that record to where DateNotified is now().

I'm sure there are probably 10 ways to accomplish the same thing, that's just one that came to the top of my head - someone will probably post something better.
 

Minty

AWF VIP
Local time
Today, 00:32
Joined
Jul 26, 2013
Messages
10,367
I'm sure there was a lengthy thread on here somewhere that discussed this type of remote notification.
Suffice to say it's not as simple as you might think.

Also if you refresh the form in mid edit what happens to the underlying data?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 18:32
Joined
Feb 28, 2001
Messages
27,129
There is an automatic "implied" refresh every so often, which you can control from the Form >> Options >> Current Database displays. The "lengthy" thread to which Minty referred included my contribution that you can't do this as easily as you think because you are not allowed to have process A1 on computer A interfere with the operation of process B2 on computer B. This is a basic security principle and Windows will get in the way if you try to IMPOSE a change. You have to implement some sort of protocol that operates among ALL potential members of the group of processes that deal with this common data set.

The "timer" and time-tag approach is probably the easiest way to do this. Anything else runs afoul of a basic security principle called "object isolation" - which is so fundamental that it is almost impossible to implement without first programming your FE to expect it in a specific way.
 

NauticalGent

Ignore List Poster Boy
Local time
Yesterday, 19:32
Joined
Apr 27, 2015
Messages
6,319

Gismo

Registered User.
Local time
Today, 02:32
Joined
Jun 12, 2017
Messages
1,298
I'm sure there was a lengthy thread on here somewhere that discussed this type of remote notification.
Suffice to say it's not as simple as you might think.

Also if you refresh the form in mid edit what happens to the underlying data?
Hi,

the for that needs to be updated is purely a status of the data, it is not in any way an entry form
 

Users who are viewing this thread

Top Bottom