reducing sytem resource cost

Oliver1

Registered User.
Local time
Today, 09:35
Joined
Aug 27, 2004
Messages
10
Hi,

Thanks for your previous help, and I'm hoping you might be able to get me out of another tricky situation.
I have a table which is updated by an external program every 5 seconds or so.
I am currently looking at this table using the below bit of code. Were the refreshcalldata method opens a record set and populates the data from the table into some text boxes on a form then closes the recordset. This is a very processor hungry operation, especially as I just want to see what’s in the table in real-time. If I just open the table itself it only seems to update very sporadically but takes next to no system resources.
Additionally I’m currently altering the appearance of the text boxes depending on the contents of the recordset\table.
Is there anyway to make this a background job, or at least make it less processor hungry.
For a bit of background the table I’m looking at shows if the persons name and if they are currently making a phone call or not.


Do While stopper <> 1
PauseTime = 2
start = Timer
Do While Timer < start + PauseTime
DoEvents
Loop
If stopper <> 1 Then
refreshcalldata
End If
Loop
 
Oliver,

Not a lot of specifics here.

I'd base a query on the table.

Make a continuous form based on the query and use Conditional Formatting
to get the desired visual results.

Then I'd put an OnDemand Requery button (Me.Requery).

Wayne
 
Background

I would ideally like the form to run in the background without any interaction from myself.
If I use the below bit of code
Do While stopper <> 1
PauseTime = 5 ' Set duration.
start = Timer ' Set start time.
Do While Timer < start + PauseTime
DoEvents
Loop
If stopper <> 1 Then
Me.Form.Requery
End If

Loop

It still sucks up all my processing power, admittedly it does yield to other processor but by default it uses 100% of my processor. This is causing jerkiness on my computer, which is liveable, but as I wish to roll my form out to about 10 users, I'm sure they will not be so forgiving. Have looked at the VBA help. And it mentions using a timer. Which I tried as below without the doevents function, but this was even worse.

Do While stopper <> 1
PauseTime = 5 ' Set duration.
start = Timer ' Set start time.
Do While Timer < start + PauseTime
Loop
If stopper <> 1 Then
Me.Form.Requery
End If

Loop
 

Users who are viewing this thread

Back
Top Bottom