PC Review


Reply
Thread Tools Rate Thread

asynchronous processing

 
 
=?Utf-8?B?SGF3a2lkZQ==?=
Guest
Posts: n/a
 
      6th Jun 2005
I have a a form with a listbox. When the form is opened, a query is run to
populate the listbox. The query is somewhat slow (5 - 10 seconds depending
on network traffic). My users pointed out that after they open the form they
often click button X immediately to open another form. The button does not
seem to respond until after the listbox query is completed (needless to sat,
they are anoyed). I use the following code
------------------------------------------------------------------------------------------------

Private Sub Form_Timer()
On Error Resume Next 'Ok

'only run once:
Me.TimerInterval = 0

'load list and allow user to continue doing stuff:
Me.lstSamples.RowSource = "qryShowLabStats"

'continue processing events (so users can click btns):
DoEvents

End Su
------------------------------------------------------------------------------------------------
I just found the following in the help file:

In Microsoft Access, the DoEvents function is ignored if you use it in:

· A user-defined function or a procedure that calculates a field in a
query, form, or report.
· A user-defined function that creates a list to fill a combo box, a list
box, or an OLE object.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2xhdHV1?=
Guest
Posts: n/a
 
      6th Jun 2005
How about if when they click to open this form, you present a text box to the
user that says something like "Retrieving Data" and don't make the form
visible until the query completes?

"Hawkide" wrote:

> I have a a form with a listbox. When the form is opened, a query is run to
> populate the listbox. The query is somewhat slow (5 - 10 seconds depending
> on network traffic). My users pointed out that after they open the form they
> often click button X immediately to open another form. The button does not
> seem to respond until after the listbox query is completed (needless to sat,
> they are anoyed). I use the following code:
> ------------------------------------------------------------------------------------------------
>
> Private Sub Form_Timer()
> On Error Resume Next 'Ok
>
> 'only run once:
> Me.TimerInterval = 0
>
> 'load list and allow user to continue doing stuff:
> Me.lstSamples.RowSource = "qryShowLabStats"
>
> 'continue processing events (so users can click btns):
> DoEvents
>
> End Sub
> ------------------------------------------------------------------------------------------------
> I just found the following in the help file:
>
> In Microsoft Access, the DoEvents function is ignored if you use it in:
>
> · A user-defined function or a procedure that calculates a field in a
> query, form, or report.
> · A user-defined function that creates a list to fill a combo box, a list
> box, or an OLE object.

 
Reply With Quote
 
=?Utf-8?B?SGF3a2lkZQ==?=
Guest
Posts: n/a
 
      6th Jun 2005
Well, I would prefer that the user does not have to wait, so I am really
looking for a solution that woulkd either let the query run in the background
while the Button_Click event is processed OR the query could actually stop
processing when the button is clicked.

"Klatuu" wrote:

> How about if when they click to open this form, you present a text box to the
> user that says something like "Retrieving Data" and don't make the form
> visible until the query completes?
>
> "Hawkide" wrote:
>
> > I have a a form with a listbox. When the form is opened, a query is run to
> > populate the listbox. The query is somewhat slow (5 - 10 seconds depending
> > on network traffic). My users pointed out that after they open the form they
> > often click button X immediately to open another form. The button does not
> > seem to respond until after the listbox query is completed (needless to sat,
> > they are anoyed). I use the following code:
> > ------------------------------------------------------------------------------------------------
> >
> > Private Sub Form_Timer()
> > On Error Resume Next 'Ok
> >
> > 'only run once:
> > Me.TimerInterval = 0
> >
> > 'load list and allow user to continue doing stuff:
> > Me.lstSamples.RowSource = "qryShowLabStats"
> >
> > 'continue processing events (so users can click btns):
> > DoEvents
> >
> > End Sub
> > ------------------------------------------------------------------------------------------------
> > I just found the following in the help file:
> >
> > In Microsoft Access, the DoEvents function is ignored if you use it in:
> >
> > · A user-defined function or a procedure that calculates a field in a
> > query, form, or report.
> > · A user-defined function that creates a list to fill a combo box, a list
> > box, or an OLE object.

 
Reply With Quote
 
=?Utf-8?B?S2xhdHV1?=
Guest
Posts: n/a
 
      6th Jun 2005
I don't have any clever suggestions. Is your network very slow? Is the
database really large? Maybe there is a way to speed up your query by the
way you define it. One thing that may help is to create indexes on the
fields in the table the query is referencing.

Maybe you need faster computers or slower users

"Hawkide" wrote:

> Well, I would prefer that the user does not have to wait, so I am really
> looking for a solution that woulkd either let the query run in the background
> while the Button_Click event is processed OR the query could actually stop
> processing when the button is clicked.
>
> "Klatuu" wrote:
>
> > How about if when they click to open this form, you present a text box to the
> > user that says something like "Retrieving Data" and don't make the form
> > visible until the query completes?
> >
> > "Hawkide" wrote:
> >
> > > I have a a form with a listbox. When the form is opened, a query is run to
> > > populate the listbox. The query is somewhat slow (5 - 10 seconds depending
> > > on network traffic). My users pointed out that after they open the form they
> > > often click button X immediately to open another form. The button does not
> > > seem to respond until after the listbox query is completed (needless to sat,
> > > they are anoyed). I use the following code:
> > > ------------------------------------------------------------------------------------------------
> > >
> > > Private Sub Form_Timer()
> > > On Error Resume Next 'Ok
> > >
> > > 'only run once:
> > > Me.TimerInterval = 0
> > >
> > > 'load list and allow user to continue doing stuff:
> > > Me.lstSamples.RowSource = "qryShowLabStats"
> > >
> > > 'continue processing events (so users can click btns):
> > > DoEvents
> > >
> > > End Sub
> > > ------------------------------------------------------------------------------------------------
> > > I just found the following in the help file:
> > >
> > > In Microsoft Access, the DoEvents function is ignored if you use it in:
> > >
> > > · A user-defined function or a procedure that calculates a field in a
> > > query, form, or report.
> > > · A user-defined function that creates a list to fill a combo box, a list
> > > box, or an OLE object.

 
Reply With Quote
 
David C. Holley
Guest
Posts: n/a
 
      6th Jun 2005
What is the nature of the query and the information that its retreiving?
It could be the design of the query is ineffiecent(sp) or that there
is another way to get the information. For that matter, what is
information is being presented in the list box?

Hawkide wrote:
> Well, I would prefer that the user does not have to wait, so I am really
> looking for a solution that woulkd either let the query run in the background
> while the Button_Click event is processed OR the query could actually stop
> processing when the button is clicked.
>
> "Klatuu" wrote:
>
>
>>How about if when they click to open this form, you present a text box to the
>>user that says something like "Retrieving Data" and don't make the form
>>visible until the query completes?
>>
>>"Hawkide" wrote:
>>
>>
>>>I have a a form with a listbox. When the form is opened, a query is run to
>>>populate the listbox. The query is somewhat slow (5 - 10 seconds depending
>>>on network traffic). My users pointed out that after they open the form they
>>>often click button X immediately to open another form. The button does not
>>>seem to respond until after the listbox query is completed (needless to sat,
>>>they are anoyed). I use the following code:
>>>------------------------------------------------------------------------------------------------
>>>
>>>Private Sub Form_Timer()
>>> On Error Resume Next 'Ok
>>>
>>>'only run once:
>>> Me.TimerInterval = 0
>>>
>>>'load list and allow user to continue doing stuff:
>>> Me.lstSamples.RowSource = "qryShowLabStats"
>>>
>>>'continue processing events (so users can click btns):
>>> DoEvents
>>>
>>>End Sub
>>>------------------------------------------------------------------------------------------------
>>>I just found the following in the help file:
>>>
>>>In Microsoft Access, the DoEvents function is ignored if you use it in:
>>>
>>>· A user-defined function or a procedure that calculates a field in a
>>>query, form, or report.
>>>· A user-defined function that creates a list to fill a combo box, a list
>>>box, or an OLE object.

 
Reply With Quote
 
David C. Holley
Guest
Posts: n/a
 
      6th Jun 2005
You could do what my former company's IT department would probably
recommend - Tell the users that they're just going to have to wait.

Klatuu wrote:
> I don't have any clever suggestions. Is your network very slow? Is the
> database really large? Maybe there is a way to speed up your query by the
> way you define it. One thing that may help is to create indexes on the
> fields in the table the query is referencing.
>
> Maybe you need faster computers or slower users
>
> "Hawkide" wrote:
>
>
>>Well, I would prefer that the user does not have to wait, so I am really
>>looking for a solution that woulkd either let the query run in the background
>>while the Button_Click event is processed OR the query could actually stop
>>processing when the button is clicked.
>>
>>"Klatuu" wrote:
>>
>>
>>>How about if when they click to open this form, you present a text box to the
>>>user that says something like "Retrieving Data" and don't make the form
>>>visible until the query completes?
>>>
>>>"Hawkide" wrote:
>>>
>>>
>>>>I have a a form with a listbox. When the form is opened, a query is run to
>>>>populate the listbox. The query is somewhat slow (5 - 10 seconds depending
>>>>on network traffic). My users pointed out that after they open the form they
>>>>often click button X immediately to open another form. The button does not
>>>>seem to respond until after the listbox query is completed (needless to sat,
>>>>they are anoyed). I use the following code:
>>>>------------------------------------------------------------------------------------------------
>>>>
>>>>Private Sub Form_Timer()
>>>> On Error Resume Next 'Ok
>>>>
>>>>'only run once:
>>>> Me.TimerInterval = 0
>>>>
>>>>'load list and allow user to continue doing stuff:
>>>> Me.lstSamples.RowSource = "qryShowLabStats"
>>>>
>>>>'continue processing events (so users can click btns):
>>>> DoEvents
>>>>
>>>>End Sub
>>>>------------------------------------------------------------------------------------------------
>>>>I just found the following in the help file:
>>>>
>>>>In Microsoft Access, the DoEvents function is ignored if you use it in:
>>>>
>>>>· A user-defined function or a procedure that calculates a field in a
>>>>query, form, or report.
>>>>· A user-defined function that creates a list to fill a combo box, a list
>>>>box, or an OLE object.

 
Reply With Quote
 
=?Utf-8?B?U2tpcHB5MTMxMw==?=
Guest
Posts: n/a
 
      7th Jul 2005
Add another button to the form next to the listbox. Don't populate the
listbox until the user clicks the new button.

"Hawkide" wrote:

> I have a a form with a listbox. When the form is opened, a query is run to
> populate the listbox. The query is somewhat slow (5 - 10 seconds depending
> on network traffic). My users pointed out that after they open the form they
> often click button X immediately to open another form. The button does not
> seem to respond until after the listbox query is completed (needless to sat,
> they are anoyed). I use the following code:
> ------------------------------------------------------------------------------------------------
>
> Private Sub Form_Timer()
> On Error Resume Next 'Ok
>
> 'only run once:
> Me.TimerInterval = 0
>
> 'load list and allow user to continue doing stuff:
> Me.lstSamples.RowSource = "qryShowLabStats"
>
> 'continue processing events (so users can click btns):
> DoEvents
>
> End Sub
> ------------------------------------------------------------------------------------------------
> I just found the following in the help file:
>
> In Microsoft Access, the DoEvents function is ignored if you use it in:
>
> · A user-defined function or a procedure that calculates a field in a
> query, form, or report.
> · A user-defined function that creates a list to fill a combo box, a list
> box, or an OLE object.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Asynchronous Processing Frankie Microsoft ASP .NET 2 18th Sep 2007 05:24 AM
Asynchronous processing =?Utf-8?B?RGlmZmlkZW50?= Microsoft ASP .NET 2 22nd Nov 2006 04:37 PM
How do you do asynchronous processing in C# GS Microsoft C# .NET 0 8th Feb 2006 09:44 PM
Asynchronous Processing Web age Thomas Nielsen Microsoft ASP .NET 3 11th Jul 2004 02:09 PM
Asynchronous processing vnarod Microsoft VB .NET 0 10th Jun 2004 06:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:39 PM.