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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with displaying hourglass

Status
Not open for further replies.

48Highlander

Technical User
Feb 8, 2004
119
CA
In my form I have a button that opens an HTML file and puts all of the HTML into a text box. It takes several seconds for the file to be opened. Before I call the function that calls the GetOpenFile api, I want to display the hourglass but it never displays.

I have the following code:
Code:
    DoCmd.Hourglass True
   
    DoCmd.Echo True, "Retrieving file, please wait...."
    
    strFilter = "HTML (*.htm, *.html)" & vbNullChar & "*.htm;*.html" & _
                             vbNullChar & "All Files (*.*)" & vbNullChar & "*.*"
    
    vFilePaths = fGetFile(e_FileMustExist + e_Explorer, , strFilter, , , , _
                          "Choose file for e-mail body ...", , 4096)
                             
    If Nz(vFilePaths, "") = "" Then
        MsgBox "You did not select a file to import", vbExclamation, "Action cancelled"
        GoTo Continue
    End If

    Me.txtHTMLpage = vFilePaths
    Me.txtBody = ""
    If oSMTP.ImportMailEx(Me.txtHTMLpage) <> 0 Then
        MsgBox "Failed to add HTML page with error:" & vbCrLf & oSMTP.GetLastErrDescription(), vbExclamation, "Error"
        bSMTPSuccess = False
        Exit Sub
    End If
    
    Me.txtBody = oSMTP.BodyText

I have been fiddling around with DoEvents but I don't think I am using it correctly. What can I do to get the hourglass to display? Other than just displaying a tiny message on the status bar, is there anything else I can do to ensure the user patiently waits for the file to be loaded?

Bill J
 
What can I do to get the hourglass to display?" - what did you try?

I don't see anywhere in your code any:
[tt]
Me.MousePointer = fmMousePointerHourGlass
Me.MousePointer = fmMousePointerDefault[/tt]



Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
The first line in the code snippet should turn on the hourglass. Right?

Bill J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top