Userform handling

  • Thread starter Thread starter rodrigo
  • Start date Start date
R

rodrigo

Hi all.
My question is, how can i set off a part of an userform if a checkbox is
set as true? the idea is that all other coices get "grey" and can't be
handled until the input of the relationed data is finished.
Exapmle: the checkbox should verify if a person pays cash or a credit
card. if he pays cash, the information about the credit card should'n be
available.

thx a lot,
rodrigo
 
Hi,

You can set the Enabled property to True or False depending on whether
its relevant.
Some thing like this where the checkbox with tick is for Credit card stuff.

Private Sub CheckBox1_Click()
With CheckBox1
' credit card related
Label1.Enabled = .Value
TextBox1.Enabled = .Value

' cash related
Label2.Enabled = Not .Value
Label2.Enabled = Not .Value
End With
End Sub

Cheers
Andy
 
on the click event of the checkbox, check that its value is true, then set
the enabled property of the controls you want greyed to false. Using
Frames might make some of this easier. Disabling the frame will disable the
controls in the frame (although the controls are not greyed - only the frame
is).
 
Something like

Private Sub CheckBox1_Click()
With TextBox1
If Me.CheckBox1.Value Then
.Enabled = True
.BackColor = &HFFFFFF
Else
.Enabled = False
.BackColor = 12632256
End If
End With
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top