Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2002
    Location
    San Antonio, TX
    Posts
    69

    Unanswered: A97: Strangeness in flow

    In an Access 97 database, I have the following code attached to the Change event of a combobox of a form. The code works fine except for the DoCmd.Hourglass commands. The DoCmd.Hourglass commands seem to both happen at the end after everything else runs and therefore you don't see the hourglass. If I comment out the DoCmd.Hourglass False command at the end of the Sub, then the hourglass will appear but only after everything else has run. As you can see from the code, the hourglass should show up before the rest of the code runs but it isn't. Any ideas?

    Code:
    Private Sub Combo0_Change()
        Dim rec As Recordset
        Dim strSQL As String
        
        DoCmd.Hourglass True
        
        strSQL = "SELECT REPORTS_V_EMPLOYEE.[FILE#], REPORTS_V_EMPLOYEE.[SOCIALSECURITY#], " & _
                         "REPORTS_V_EMPLOYEE.HOMEDEPARTMENT FROM REPORTS_V_EMPLOYEE " & _
                         "WHERE (((REPORTS_V_EMPLOYEE.COMPANYCODE)=" & Chr(34) & [Forms]![fGarnishments]![Combo1] & Chr(34) & ") " & _
                         "AND ((REPORTS_V_EMPLOYEE.[FILE#])=" & Chr(34) & [Forms]![fGarnishments]![Combo0] & Chr(34) & "));"
        
        Me.Combo20.RowSource = "SELECT REPORTS_V_LIENS.[LIENCASE#] " & _
                                                      "FROM REPORTS_V_LIENS INNER JOIN REPORTS_V_EMPLOYEE " & _
                                                      "ON (REPORTS_V_LIENS.[FILE#] = REPORTS_V_EMPLOYEE.[FILE#]) " & _
                                                      "AND (REPORTS_V_LIENS.COMPANYCODE = REPORTS_V_EMPLOYEE.COMPANYCODE) " & _
                                                      "WHERE (((REPORTS_V_LIENS.COMPANYCODE) " & _
                                                      " = " & Chr(34) & [Forms]![fGarnishments]![Combo1] & Chr(34) & ") AND ((REPORTS_V_LIENS.[FILE#]) " & _
                                                      " = " & Chr(34) & [Forms]![fGarnishments]![Combo0] & Chr(34) & "));"
    
        Set rec = CurrentDb.OpenRecordset(strSQL)
        Me.Text2 = rec![FILE#]
        Me.Text4 = rec![SOCIALSECURITY#]
        Me.Text6 = rec![HOMEDEPARTMENT]
        Me.Text24 = ""
        Me.Text26 = ""
        Me.Text28 = ""
        Me.Text30 = ""
        Me.Text32 = ""
        Me.Text34 = ""
    
        rec.Close
        Set rec = Nothing
        DoCmd.Hourglass False
    End Sub
    "Doing stuff is overrated. Take Hitler for example. He did lots but don't we all wish he'd have just stayed home and gotten stoned?"

  2. #2
    Join Date
    Feb 2002
    Location
    San Antonio, TX
    Posts
    69
    Nevermind. I moved the DoCmd.Hourglass True command over to the Click event and it all works now.
    "Doing stuff is overrated. Take Hitler for example. He did lots but don't we all wish he'd have just stayed home and gotten stoned?"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •