"Grey Out" text boxes on forms

Bisleycat2002

New Member
Joined
Sep 17, 2002
Messages
41
Can anyone tell me how I go about "greying out" text boxes on a form dependent on the answer to user input on a preceding input on the record i.e. if they answer yes in one box then a subsequent question appears to be "greyed out" indicating it does not require a response.

Thanks
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
There are various ways.

On of which is to use the AfterUpdate of the preceding text box.

eg
Code:
Private Sub Text1_AfterUpdate(Cancel As Integer)
    If UCase(Text1) = "YES" Then
        Text2.Enabled = False
    End If
End Sub
 
Upvote 0
Yes

Are the options in a frame?

Then use the frame's after update event.

eg

Code:
Private Sub Frame0_AfterUpdate()
    If Frame0.Value = 2 Then
        Text1.Enabled = False
    Else
        Text1.Enabled = True
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,221,821
Messages
6,162,157
Members
451,750
Latest member
pnkundalia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top