G
Guest
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.
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.