![]() |
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 |
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 |
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 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 |
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 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 |
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 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 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 |
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 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 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 |
All times are GMT +1. The time now is 12:06 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com