Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi all, I have a userform with some text boxes, and I want one of them to be grayed out depending on the entry in the one before it. If the user types "FL" in the first box, I want the second to be disabled. The trouble is that I want it to check this after the entry in the first box is made and while the userform is still up. How do I make it happen after the entry is made? It would also work if I could make it happen upon tabbing out of the box or into another. Here's the code I'm trying: Private Sub txtFee_Change() 'grays out the fee box if txtState = FL If txtState = "FL" Then txtFee.Enabled = False Else: txtFee.Enabled = True End If End Sub This code is fine and works for graying out, but only if the txtState = "FL" at initialization. I want it to work right when FL is entered. Thanks for your help! -- Lost! ------------------------------------------------------------------------ Lost!'s Profile: http://www.excelforum.com/member.php...o&userid=23990 View this thread: http://www.excelforum.com/showthread...hreadid=385312 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, To acomplish what you need intead of Code: -------------------- Private Sub txtFee_Change() 'grays out the fee box if txtState = FL If txtState = "FL" Then txtFee.Enabled = False Else: txtFee.Enabled = True End If End Sub -------------------- Try Private Sub txtFee_AfterUpdate() 'grays out the fee box if txtState = FL If txtState = "FL" Then txtFee.Enabled = False Else: txtFee.Enabled = True End If End Sub In design mode double click the txtFee Text Box and insert the modified code. If it works invite us to Florida:) Success Jose Luis Lost! Wrote: Hi all, I have a userform with some text boxes, and I want one of them to be grayed out depending on the entry in the one before it. If the user types "FL" in the first box, I want the second to be disabled. The trouble is that I want it to check this after the entry in the first box is made and while the userform is still up. How do I make it happen after the entry is made? It would also work if I could make it happen upon tabbing out of the box or into another. Here's the code I'm trying: Private Sub txtFee_Change() 'grays out the fee box if txtState = FL If txtState = "FL" Then txtFee.Enabled = False Else: txtFee.Enabled = True End If End Sub This code is fine and works for graying out, but only if the txtState = "FL" at initialization. I want it to work right when FL is entered. Thanks for your help! -- jose luis ------------------------------------------------------------------------ jose luis's Profile: http://www.excelforum.com/member.php...o&userid=13312 View this thread: http://www.excelforum.com/showthread...hreadid=385312 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() That worked perfectly. Thanks! -- Lost ----------------------------------------------------------------------- Lost!'s Profile: http://www.excelforum.com/member.php...fo&userid=2399 View this thread: http://www.excelforum.com/showthread.php?threadid=38531 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Action Event, CheckBox, Add Row and Textbox | Excel Discussion (Misc queries) | |||
Auto entry clock into a cell on tabbing into it | Excel Worksheet Functions | |||
textbox tabbing????? | Excel Discussion (Misc queries) | |||
Validate textbox entry | Excel Programming | |||
TextBox Controls--tabbing | Excel Programming |