Thanks for the help. - Henry
Well, I almost had it....
I can trigger the hourglass, but then it disappears, the system looks
like it is idle for 30 seconds or so, and then the Message Box appears.
I would expect something more immediate. Any ideas or solutions?
'====================================
Private Sub lblUpdateMDList_Click()
On Error GoTo PROC_ERR
Dim dbs As DAO.Database
Dim sSql As String
Set dbs = CurrentDb()
DoCmd.Hourglass True
DoEvents
' 1) Delete and append records
sSql = "DROP TABLE tblRepLookUp"
dbs.Execute sSql
sSql = "SELECT qryMDHospRep.hosCustomerID, "
sSql = sSql & "qryMDHospRep.phyPhysicianID, "
sSql = sSql & "qryMDHospRep.SalesRepID, qryMDHospRep."
sSql = sSql & "SalesRepFirstName, qryMDHospRep."
sSql = sSql & "SalesRepLastName, qryMDHospRep.SalesRep, "
sSql = sSql & "qryMDHospRep.SalesRepType, qryMDHospRep."
sSql = sSql & "RegionRepID, qryMDHospRep."
sSql = sSql & "RegionManagerFirstName, qryMDHospRep."
sSql = sSql & "RegionManagerLastName, qryMDHospRep."
sSql = sSql & "RegionManager INTO tblRepLookUp "
sSql = sSql & "FROM qryMDHospRep;"
dbs.Execute sSql
DoCmd.Hourglass False
MsgBox "Physician List Complete", vbInformation + vbOKOnly, "Process
Complete"
Set dbs = Nothing
Exit Sub
PROC_ERR:
MsgBox "The following error occured: " & Error$
Resume Next
End Sub
'==========================
Thanks in advance,
Henry
Lyle Fairfield - 30 Apr 2006 12:52 GMT
I never use DoCmd Hourglass being entirely satisfied 99.94% of the time
with the Access GUI straight from the box.
I see you've pasted this problem more than once so I'll chip in with my
!!!GUESS!!! which is that Access turns the Hourglass off automatically
after
sSql = "DROP TABLE tblRepLookUp"
dbs.Execute sSql
and that you might !!!TRY!!! moving
DoCmd.Hourglass True
DoEvents
to the line immediately following those.
In passing, I suppose you have considered that most accomplished
developers would not drop and create the tblRepLookUp but simply refer
directly to the query that you are using to populate it. One can assume
that the query executes slowly, as you are using the Hourglass; perhaps
this requires attention?
In addition, I recall in the olden days when Access and hardware were
much slower but I was quicker, I set the Status Bar on when running a
slow query; this gave an automatic progress bar at the bottom of the
screen tracking query execution progress.