Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings,
I have a CommandButton on a UserForm that is supposed to become not visible if a TextBox has anything in it. It stays visible no matter what is in the TextBox. Here is the code I am using: __________________________________________________ _______________ Public Sub I3Refresh() Dim i As Integer 'Reload all TextBoxes from the value in I_3.List(I_3.ListIndex, 1) 'when I_3 changes For i = 1 To 105 Select Case i Case 2 'Invoice number I_2 = I_3.List(I_3.ListIndex, 1) Select Case I_2.Value Case vbNullString 'Invoice number is NOT present MsgBox "I_2 is Empty" & I_2 btnNextInvNumber.Visible = True Case Else 'Invoice number is present MsgBox "I_2 Has A Number" & I_2 btnNextInvNumber.Visible = False '<<<<<<<<< MsgBox "Next Invoice Number should be invisible" End Select Case 3 'Special case CRefName.Value = _ I_3.List(I_3.ListIndex, 2) Case Else 'Normal data transfer Me.Controls("I_" & i) = _ I_3.List(I_3.ListIndex, i - 1) End Select Next i End Sub __________________________________________________ _______________ If anything is in the TextBox called I_2 then the CommandButton (btnNextInvNumber) which is sitting in the same space as the TextBox needs to become not visible so that the user can see the Invoice number. And if the TextBox has nothing to show, then the empty TextBox should be covered with the CommandButton, until there is something in the TextBox. The MsgBoxes on either side of the visible code both fire at the appropriate times, the visible code doesn't seem to fire!!! Does anyone see anything that could be wrong with this line? btnNextInvNumber.Visible = False I rechecked the name of the button and it is correct. Any help would be greatly appreciated. -Minitman |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Ref Commandbutton | Excel Programming | |||
Ref Commandbutton | Excel Programming | |||
how to get commandbutton name | Excel Programming | |||
Wrapped text disappering in Excel 2003 | Excel Discussion (Misc queries) | |||
Commandbutton | Excel Programming |