Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCMD.Hourglass True does not work within module!

Status
Not open for further replies.

StellaIndigo

IS-IT--Management
Sep 19, 2002
118
0
0
GB
Hi

I'm having problems with getting the cursor to change from the pointer to hourglass and back again.

I'm using Access 2002 with Service Pack 3

The following code is called from an OnClick event from a form "Form_SwitchBoard". The code does run, as it loads data into a table then deletes the import file. The DoCmd.Hourglass HourglassOn command does not work. The cursor stays as pointer.

Code:
Sub LoadXMLFiles()
  DoCmd.Hourglass HourglassOn
  DoCmd.SetWarnings False
  Set fs = Application.FileSearch
  On Error GoTo ErrorHandler
  DoEvents
  With fs
    .LookIn = "c:\temp\"
    .filename = "*.xml"
    If .Execute(msoSortByLastModified, msoSortOrderAscending) > 0 Then
      For i = 1 To .FoundFiles.Count
        Form_Switchboard.lblloading.Caption = .FoundFiles(i)
        Form_Switchboard.Refresh
        Application.ImportXML DataSource:=.FoundFiles(i), ImportOptions:=acAppendData
        Kill .FoundFiles(i)
      Next i
    End If
  End With
  GoTo tidyup
ErrorHandler:
    MsgBox Err.Number & " " & Err.Description & " with file " & fs.FoundFiles(i), vbOKOnly
tidyup:
    Form_Switchboard.lblloading.Caption = ""
    DoCmd.SetWarnings True
    DoCmd.Hourglass False
End Sub

Any ideas?

Stella

Regards
Stella

There are 10 types of people in the world. Those that understand binary and those that don't.
 
Replace this:
DoCmd.Hourglass HourglassOn
By this:
DoCmd.Hourglass True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV

Tried

DoCMD.Hourglass True

but it still doesn't want to work.

Stella

Regards
Stella

There are 10 types of people in the world. Those that understand binary and those that don't.
 
Try:

DoCmd.Hourglass (1)

to turn it on, or:

DoCmd.Hourglass (0)

to turn it off.

Cheers
Andy

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top