+ Reply to Thread
Results 1 to 6 of 6

Hiding A TextBox On A UserForm Under A CommandButton

  1. #1
    Minitman
    Guest

    Hiding A TextBox On A UserForm Under A CommandButton

    Greetings,

    I have a TextBox that sits in the same place as a CommandButton.
    Their visibility is turned on and off with code. It was working until
    I needed to press the CommandButton to run a subroutine. That
    is when I discovered that I had to have the TextBox visible to prevent
    an error from showing up. The problem is that the visible TextBox
    sits on top of the CommandButton and I need it to be under (covered
    by) the CommandButton (The CommandButton becomes non visible
    before the TextBox is needed).

    Does anyone know how to do this?

    TIA

    -Minitman

  2. #2
    Dave Peterson
    Guest

    Re: Hiding A TextBox On A UserForm Under A CommandButton

    You could toggle the .zorder property.

    Me.CommandButton1.ZOrder 1

    0 = it's on top
    1 = it's on bottom



    Minitman wrote:
    >
    > Greetings,
    >
    > I have a TextBox that sits in the same place as a CommandButton.
    > Their visibility is turned on and off with code. It was working until
    > I needed to press the CommandButton to run a subroutine. That
    > is when I discovered that I had to have the TextBox visible to prevent
    > an error from showing up. The problem is that the visible TextBox
    > sits on top of the CommandButton and I need it to be under (covered
    > by) the CommandButton (The CommandButton becomes non visible
    > before the TextBox is needed).
    >
    > Does anyone know how to do this?
    >
    > TIA
    >
    > -Minitman


    --

    Dave Peterson

  3. #3
    Minitman
    Guest

    Re: Hiding A TextBox On A UserForm Under A CommandButton

    Hey Dave,

    Thanks for the reply.

    Unfortunately, it appears that ZOrder is not for UserForm controls,
    unless I am doing something wrong.

    I'm not sure what happened, but I seem to be in debug mode of some
    kind and I can't get out.

    Any ideas?

    -Minitman

    On Thu, 25 Aug 2005 18:14:20 -0500, Dave Peterson
    <[email protected]> wrote:

    >You could toggle the .zorder property.
    >
    >Me.CommandButton1.ZOrder 1
    >
    >0 = it's on top
    >1 = it's on bottom
    >
    >
    >
    >Minitman wrote:
    >>
    >> Greetings,
    >>
    >> I have a TextBox that sits in the same place as a CommandButton.
    >> Their visibility is turned on and off with code. It was working until
    >> I needed to press the CommandButton to run a subroutine. That
    >> is when I discovered that I had to have the TextBox visible to prevent
    >> an error from showing up. The problem is that the visible TextBox
    >> sits on top of the CommandButton and I need it to be under (covered
    >> by) the CommandButton (The CommandButton becomes non visible
    >> before the TextBox is needed).
    >>
    >> Does anyone know how to do this?
    >>
    >> TIA
    >>
    >> -Minitman



  4. #4
    Dave Peterson
    Guest

    Re: Hiding A TextBox On A UserForm Under A CommandButton

    I tested it using a userform.

    You may want to post the code (or look in VBA's help).

    Minitman wrote:
    >
    > Hey Dave,
    >
    > Thanks for the reply.
    >
    > Unfortunately, it appears that ZOrder is not for UserForm controls,
    > unless I am doing something wrong.
    >
    > I'm not sure what happened, but I seem to be in debug mode of some
    > kind and I can't get out.
    >
    > Any ideas?
    >
    > -Minitman
    >
    > On Thu, 25 Aug 2005 18:14:20 -0500, Dave Peterson
    > <[email protected]> wrote:
    >
    > >You could toggle the .zorder property.
    > >
    > >Me.CommandButton1.ZOrder 1
    > >
    > >0 = it's on top
    > >1 = it's on bottom
    > >
    > >
    > >
    > >Minitman wrote:
    > >>
    > >> Greetings,
    > >>
    > >> I have a TextBox that sits in the same place as a CommandButton.
    > >> Their visibility is turned on and off with code. It was working until
    > >> I needed to press the CommandButton to run a subroutine. That
    > >> is when I discovered that I had to have the TextBox visible to prevent
    > >> an error from showing up. The problem is that the visible TextBox
    > >> sits on top of the CommandButton and I need it to be under (covered
    > >> by) the CommandButton (The CommandButton becomes non visible
    > >> before the TextBox is needed).
    > >>
    > >> Does anyone know how to do this?
    > >>
    > >> TIA
    > >>
    > >> -Minitman


    --

    Dave Peterson

  5. #5
    Minitman
    Guest

    Re: Hiding A TextBox On A UserForm Under A CommandButton

    Hey Dave,

    Found the problem (a typo). ZOrder does indeed work.

    Thank you.

    -Minitman




    On Thu, 25 Aug 2005 22:33:26 -0500, Dave Peterson
    <[email protected]> wrote:

    >I tested it using a userform.
    >
    >You may want to post the code (or look in VBA's help).
    >
    >Minitman wrote:
    >>
    >> Hey Dave,
    >>
    >> Thanks for the reply.
    >>
    >> Unfortunately, it appears that ZOrder is not for UserForm controls,
    >> unless I am doing something wrong.
    >>
    >> I'm not sure what happened, but I seem to be in debug mode of some
    >> kind and I can't get out.
    >>
    >> Any ideas?
    >>
    >> -Minitman
    >>
    >> On Thu, 25 Aug 2005 18:14:20 -0500, Dave Peterson
    >> <[email protected]> wrote:
    >>
    >> >You could toggle the .zorder property.
    >> >
    >> >Me.CommandButton1.ZOrder 1
    >> >
    >> >0 = it's on top
    >> >1 = it's on bottom
    >> >
    >> >
    >> >
    >> >Minitman wrote:
    >> >>
    >> >> Greetings,
    >> >>
    >> >> I have a TextBox that sits in the same place as a CommandButton.
    >> >> Their visibility is turned on and off with code. It was working until
    >> >> I needed to press the CommandButton to run a subroutine. That
    >> >> is when I discovered that I had to have the TextBox visible to prevent
    >> >> an error from showing up. The problem is that the visible TextBox
    >> >> sits on top of the CommandButton and I need it to be under (covered
    >> >> by) the CommandButton (The CommandButton becomes non visible
    >> >> before the TextBox is needed).
    >> >>
    >> >> Does anyone know how to do this?
    >> >>
    >> >> TIA
    >> >>
    >> >> -Minitman



  6. #6
    Dave Peterson
    Guest

    Re: Hiding A TextBox On A UserForm Under A CommandButton

    I don't know what your typo was, but if you have "option explicit" at the top of
    your module, it can make finding some typos easier to find.

    Option explicit
    forces you to declare your variables.

    So if excel finds something that looks like a variable and it's not declared,
    your code won't compile and you'll be shown the error.

    (It won't catch them all, but it really helps.)

    Minitman wrote:
    >
    > Hey Dave,
    >
    > Found the problem (a typo). ZOrder does indeed work.
    >
    > Thank you.
    >
    > -Minitman
    >
    > On Thu, 25 Aug 2005 22:33:26 -0500, Dave Peterson
    > <[email protected]> wrote:
    >
    > >I tested it using a userform.
    > >
    > >You may want to post the code (or look in VBA's help).
    > >
    > >Minitman wrote:
    > >>
    > >> Hey Dave,
    > >>
    > >> Thanks for the reply.
    > >>
    > >> Unfortunately, it appears that ZOrder is not for UserForm controls,
    > >> unless I am doing something wrong.
    > >>
    > >> I'm not sure what happened, but I seem to be in debug mode of some
    > >> kind and I can't get out.
    > >>
    > >> Any ideas?
    > >>
    > >> -Minitman
    > >>
    > >> On Thu, 25 Aug 2005 18:14:20 -0500, Dave Peterson
    > >> <[email protected]> wrote:
    > >>
    > >> >You could toggle the .zorder property.
    > >> >
    > >> >Me.CommandButton1.ZOrder 1
    > >> >
    > >> >0 = it's on top
    > >> >1 = it's on bottom
    > >> >
    > >> >
    > >> >
    > >> >Minitman wrote:
    > >> >>
    > >> >> Greetings,
    > >> >>
    > >> >> I have a TextBox that sits in the same place as a CommandButton.
    > >> >> Their visibility is turned on and off with code. It was working until
    > >> >> I needed to press the CommandButton to run a subroutine. That
    > >> >> is when I discovered that I had to have the TextBox visible to prevent
    > >> >> an error from showing up. The problem is that the visible TextBox
    > >> >> sits on top of the CommandButton and I need it to be under (covered
    > >> >> by) the CommandButton (The CommandButton becomes non visible
    > >> >> before the TextBox is needed).
    > >> >>
    > >> >> Does anyone know how to do this?
    > >> >>
    > >> >> TIA
    > >> >>
    > >> >> -Minitman


    --

    Dave Peterson

+ 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