+ Reply to Thread
Results 1 to 5 of 5

Userform not displaying correctly

Hybrid View

  1. #1
    Trefor
    Guest

    Userform not displaying correctly

    I have the following code in a module, it works fine when I step through the
    code, but when run I end up with a Userform that is a white box on the
    screen. If I put say a Msgbox in so i can see it time this sub gets called
    the Userform is quite readable, what am I missing here?

    Sub PleaseWait(OnOff, PW_Message)
    ' This macro sets up the Please Wait Screen
    If OnOff = "ON" Then
    If Not PleaseWaitActive Then PleaseWaitDisplay.Show vbModeless
    PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message
    ElseIf OnOff = "OFF" Then
    If PleaseWaitActive Then Unload PleaseWaitDisplay
    PleaseWaitActive = False
    Else
    End If
    End Sub

    --
    Trefor

  2. #2
    Norman Jones
    Guest

    Re: Userform not displaying correctly

    Hi Trefor,

    Try inserting:

    PleaseWaitDisplay.Repaint

    after

    > PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message



    ---
    Regards,
    Norman


    "Trefor" <[email protected]> wrote in message
    news:[email protected]...
    >I have the following code in a module, it works fine when I step through
    >the
    > code, but when run I end up with a Userform that is a white box on the
    > screen. If I put say a Msgbox in so i can see it time this sub gets called
    > the Userform is quite readable, what am I missing here?
    >
    > Sub PleaseWait(OnOff, PW_Message)
    > ' This macro sets up the Please Wait Screen
    > If OnOff = "ON" Then
    > If Not PleaseWaitActive Then PleaseWaitDisplay.Show vbModeless
    > PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message
    > ElseIf OnOff = "OFF" Then
    > If PleaseWaitActive Then Unload PleaseWaitDisplay
    > PleaseWaitActive = False
    > Else
    > End If
    > End Sub
    >
    > --
    > Trefor




  3. #3
    Trefor
    Guest

    Re: Userform not displaying correctly

    Perfect, how simple was that. Many thanks.
    --
    Trefor


    "Norman Jones" wrote:

    > Hi Trefor,
    >
    > Try inserting:
    >
    > PleaseWaitDisplay.Repaint
    >
    > after
    >
    > > PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message

    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    > "Trefor" <[email protected]> wrote in message
    > news:[email protected]...
    > >I have the following code in a module, it works fine when I step through
    > >the
    > > code, but when run I end up with a Userform that is a white box on the
    > > screen. If I put say a Msgbox in so i can see it time this sub gets called
    > > the Userform is quite readable, what am I missing here?
    > >
    > > Sub PleaseWait(OnOff, PW_Message)
    > > ' This macro sets up the Please Wait Screen
    > > If OnOff = "ON" Then
    > > If Not PleaseWaitActive Then PleaseWaitDisplay.Show vbModeless
    > > PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message
    > > ElseIf OnOff = "OFF" Then
    > > If PleaseWaitActive Then Unload PleaseWaitDisplay
    > > PleaseWaitActive = False
    > > Else
    > > End If
    > > End Sub
    > >
    > > --
    > > Trefor

    >
    >
    >


  4. #4
    Greg Wilson
    Guest

    RE: Userform not displaying correctly

    Your code works fine for me. My guess is that some other code in the UF code
    module is causing the problem. I suggest commenting out all other code and
    then show it. If the problem disappears then incrementally uncomment the code
    and repeatedly show the UF until the problem starts again. This should
    isolate the offending code.

    Regards,
    Greg

    "Trefor" wrote:

    > I have the following code in a module, it works fine when I step through the
    > code, but when run I end up with a Userform that is a white box on the
    > screen. If I put say a Msgbox in so i can see it time this sub gets called
    > the Userform is quite readable, what am I missing here?
    >
    > Sub PleaseWait(OnOff, PW_Message)
    > ' This macro sets up the Please Wait Screen
    > If OnOff = "ON" Then
    > If Not PleaseWaitActive Then PleaseWaitDisplay.Show vbModeless
    > PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message
    > ElseIf OnOff = "OFF" Then
    > If PleaseWaitActive Then Unload PleaseWaitDisplay
    > PleaseWaitActive = False
    > Else
    > End If
    > End Sub
    >
    > --
    > Trefor


  5. #5
    Trefor
    Guest

    RE: Userform not displaying correctly

    Greg, Thanks for the reply but Norman's reply got it.

    --
    Trefor


    "Greg Wilson" wrote:

    > Your code works fine for me. My guess is that some other code in the UF code
    > module is causing the problem. I suggest commenting out all other code and
    > then show it. If the problem disappears then incrementally uncomment the code
    > and repeatedly show the UF until the problem starts again. This should
    > isolate the offending code.
    >
    > Regards,
    > Greg
    >
    > "Trefor" wrote:
    >
    > > I have the following code in a module, it works fine when I step through the
    > > code, but when run I end up with a Userform that is a white box on the
    > > screen. If I put say a Msgbox in so i can see it time this sub gets called
    > > the Userform is quite readable, what am I missing here?
    > >
    > > Sub PleaseWait(OnOff, PW_Message)
    > > ' This macro sets up the Please Wait Screen
    > > If OnOff = "ON" Then
    > > If Not PleaseWaitActive Then PleaseWaitDisplay.Show vbModeless
    > > PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message
    > > ElseIf OnOff = "OFF" Then
    > > If PleaseWaitActive Then Unload PleaseWaitDisplay
    > > PleaseWaitActive = False
    > > Else
    > > End If
    > > End Sub
    > >
    > > --
    > > Trefor


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1