Editing Status Bar Text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MindBender77
    New Member
    • Jul 2007
    • 233

    Editing Status Bar Text

    Hello All,
    I have a simple problem that I can seem to figure out. I want to remove the "Run Query" text from my status bar and replace it with something more custom. However, the code I've been using just flashes my custom text and reverts back to "Run Query". After the query completes my second custom message is displayed.

    This is the code I'm using:
    [code=vb]
    Dim strStatus as String
    Dim varStatus as Variant

    strStatus = "Custom Text Here....."
    varStatus = SysCmd(acSysCmd SetStatus, strStatus)
    DoCmd.RunMacro ("Update Department Tables")
    strStatus = "Custom Text Here Too..."
    varStatus = SysCmd(acSysCmd SetStatus, strStatus)
    [/code]

    Thanks in Advance,
    Bender
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    Originally posted by MindBender77
    Hello All,
    I have a simple problem that I can seem to figure out. I want to remove the "Run Query" text from my status bar and replace it with something more custom. However, the code I've been using just flashes my custom text and reverts back to "Run Query". After the query completes my second custom message is displayed.

    This is the code I'm using:
    [code=vb]
    Dim strStatus as String
    Dim varStatus as Variant

    strStatus = "Custom Text Here....."
    varStatus = SysCmd(acSysCmd SetStatus, strStatus)
    DoCmd.RunMacro ("Update Department Tables")
    strStatus = "Custom Text Here Too..."
    varStatus = SysCmd(acSysCmd SetStatus, strStatus)
    [/code]

    Thanks in Advance,
    Bender
    See this link:

    Comment

    • MindBender77
      New Member
      • Jul 2007
      • 233

      #3
      Originally posted by puppydogbuddy
      I tried the function described in this thread, however, the "Run Query" text and progress bar are still displayed. Does it matter that the query is based off an ODBC database? The code used in my first post works my other Access apps, just not this one.

      Any thoughts?

      Bender

      Comment

      • puppydogbuddy
        Recognized Expert Top Contributor
        • May 2007
        • 1923

        #4
        Originally posted by MindBender77
        I tried the function described in this thread, however, the "Run Query" text and progress bar are still displayed. Does it matter that the query is based off an ODBC database? The code used in my first post works my other Access apps, just not this one.

        Any thoughts?

        Bender
        It looks like your code is missing your eqivalent to the following line from the link I gave you.

        If S = " " Then
        Call SysCmd(acSysCmd RemoveMeter)
        .

        When you ran the function from the link I gave you, did you run it with the revisions that were made? Below is the revised code.
        Code:
        Public Function SysMs(S As String)
        On Error GoTo er
        
        
        S = S & " "
        If S = " " Then
        Call SysCmd(acSysCmdRemoveMeter)
        Else
        SysCmd acSysCmdSetStatus, S
        End If
        xt:
        Exit Function
        er:
        Resume xt
        End Function

        Comment

        • MindBender77
          New Member
          • Jul 2007
          • 233

          #5
          Originally posted by puppydogbuddy
          When you ran the function from the link I gave you, did you run it with the revisions that were made? Below is the revised code.
          Code:
          Public Function SysMs(S As String)
          On Error GoTo er
          S = S & " "
          If S = " " Then
          Call SysCmd(acSysCmdRemoveMeter)
          Else
          SysCmd acSysCmdSetStatus, S
          End If
          xt:
          Exit Function
          er:
          Resume xt
          End Function
          Without sounding like a total novice using VBA, I have two questions. First, what is S = S & " " doing exactly. The second, at what point do I call this function? Example:
          Code:
          Call SysMs
          DoCmd.OpenQuery("Some Query Here")
          Thanks Again for all the assistance,
          Bender

          Comment

          • MindBender77
            New Member
            • Jul 2007
            • 233

            #6
            I got the function to work but, it produces the same result when executed. It flashes the custom message in the status bar. It then changes to "Run Query" and finally after the query is ran, it changes back to the custom message.

            A thought comes to mind, is it possible that the "Run Query" message can not be avoided?

            Bender

            Comment

            • puppydogbuddy
              Recognized Expert Top Contributor
              • May 2007
              • 1923

              #7
              Originally posted by MindBender77
              I got the function to work but, it produces the same result when executed. It flashes the custom message in the status bar. It then changes to "Run Query" and finally after the query is ran, it changes back to the custom message.

              A thought comes to mind, is it possible that the "Run Query" message can not be avoided?

              Bender
              I am not aware of any reason why the Run Query message can't be avoided. Here are links that have examples with different takes on the function that might be worth looking into.



              Comment

              Working...