On Timer Subform Refresh..

dodyryda

Registered User.
Local time
Today, 02:38
Joined
Apr 6, 2009
Messages
61
Hi all..

I was hoping that someone may give me some tips how to handle a subform refresh.

here's the background, I have a drive schedule that many people can update, currently if you click on the calendar it refresh's a subform that displays that days info. Thing is unless you click the calendar no refresh occurs and so if someone adds a job it isn't displayed...

What I was thinking is using the On Timer event to perform a requery on the subform. something like Forms("MainFormName").SubformControlName.Form.Requery.
every 2 mins or so..

firstly is this the best way to handle this? or is there a better way. & if it's ok how in vba might i code a timer event?

Many thanks

Nathan
 
Why don't you use a requery on the after update event of the form that you enter a job on. That way, as soon as a new job is entered the refresh occurs, and not need to worry about a timer.
 
The subform is displayed on other terminals and the job can be entered on any of them. If i did that it wouldn't update the display on the remote terminals.
 
A timer can be handy in these situations.

The code would be to requery the subform. If the code is on the main form you would have just what you showed in your question. And for a two minute interval, the Timer Interval would be set to 120000.
 
sorry should have said this is an adp project with sql backend.
 
thanks bob.. so if i had something like below in On Timer. would it work?

for Me.TimerInterval = 120000
do Forms("MainFormName").SubformControlName.Form.Requery
loop
 
No For / Loop needed.

Just Put this in the MAIN Form's On Timer event:

Code:
Forms("MainFormName").SubformControlName.Form.Requery

And set the interval in the main form's Timer Interval Property: 120000
 
look at that! superb thanks..

do you think this method would create unecessary network overhead, or it's ok?
 
It is likely okay, but just keep an eye on things. How many users will have this open at one time? If not a lot then it isn't likely a problem.
 

Users who are viewing this thread

Back
Top Bottom