LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 293
Default Disappering CommandButton Doesn't

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ref Commandbutton WLMPilot Excel Programming 0 February 20th 08 03:09 PM
Ref Commandbutton WLMPilot Excel Programming 0 February 20th 08 02:51 PM
how to get commandbutton name Sean Excel Programming 2 October 17th 06 08:49 AM
Wrapped text disappering in Excel 2003 shonnahs Excel Discussion (Misc queries) 2 August 23rd 06 07:10 PM
Commandbutton alvin Kuiper Excel Programming 6 November 27th 05 06:28 PM


All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"