run a silent 'SELECT QUERY' in the background

Fred75

New member
Local time
Today, 15:07
Joined
Mar 30, 2005
Messages
8
Facing a small little problem -

I have searched the forum but to no avail...

I have designed a macro which runs a two separate OpenQueries, Save and Close statement based on a timer in an attempt to mimick the running of a silent 'SELECT QUERY' in my Access 2003 database project.

Is there a cleaner way to silently run this 'SELECT QUERY' in the Background and thus without the using the Open and Close query commands, to prevent the as my screen slicing effect as a result of this.

Thanks.
 
Last edited:
I'm not entirely sure what you mean...

You can use the following to automatically Requery a form:

' This line can be in the Form_Load event
Me.TimerInterval = 100000

' This code in the Form_Timer event
Me.RecordSource = Me.RecordSource

This is assuming that you want to run a query that is the recordsource of a form.
If it is not, post some additional information..
 
Thanks for the reply Laoujin,
I will give it a run in the morning!

But in the meatime, I was wondering if this method will requery all recordsets on my form since:
(1). It is composed of a 3 page Tab Control,
(2). Each page has its own List box lookup based on a unique 'select' query
(3). Each query perform its action on a SQL table

As mentionned in my previous post, I am running all three queries through a Macro (Action OpenQuery, Action Close) on a timer_event in order to automatically requery the linked SQL tables and update each one of the three List Boxes on my form... I believe I have attempted a form.refresh approach to no success...

But you may say Requery ain't Refresh; Point taken.
 
Last edited:
Running select queries "silently" doesn't do anything for you except waste resources. If you want to requery combos, requery them don't open separate recordsets.

WARNING - be very careful when working with forms that use timer events. Make CERTAIN that NO form with a timer event is open at a time when you are modifying code. Timer events will corrupt your forms and your only recourse will be to import an older version or recreate them from scratch. I have a database that requires timer events on many forms to requery them. I was corrupting two forms a week until I wrote code to remove all timer events and code to put them back. So, when I open the database to work on it, I run my code that turns off all the timer events. When I send a new copy to the client, I run the code that turns the timer events back on. I use a table to keep track of which forms have timer events and what their interval is.
 

Users who are viewing this thread

Back
Top Bottom