DB73
Board Regular
- Joined
- Jun 7, 2022
- Messages
- 102
- Office Version
- 365
- 2021
- 2019
- 2016
- 2010
- 2007
- Platform
- Windows
- Mobile
- Web
Hi Peeps,
Was busy with my userform and checkbox.
so with some help from this forum got myself a code.
but i have a question
as u can see after "else" i got the items that has to be uncheckt.
but it already works if i "activate" "uncheck ";
why is it not necessary to put the rest in ??
also i tried to use this;
but then it doesnt work en the comboboxes stay gry as checked the checkbox
this is the complete code:
Was busy with my userform and checkbox.
so with some help from this forum got myself a code.
but i have a question
as u can see after "else" i got the items that has to be uncheckt.
but it already works if i "activate" "uncheck ";
VBA Code:
ComboBox1.Enabled = True
ComboBox1.Value = ""
ComboBox1.BackColor = RGB(255, 255, 255)
why is it not necessary to put the rest in ??
also i tried to use this;
VBA Code:
'ComboBox1.Enabled = True
'ComboBox1.Value = ""
'ComboBox1.BackColor = RGB(255, 255, 255)
but then it doesnt work en the comboboxes stay gry as checked the checkbox
this is the complete code:
VBA Code:
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
ComboBox1.Enabled = False
ComboBox1.Value = "enkel rit registratie"
ComboBox1.BackColor = RGB(210, 210, 210)
ComboBox4.Enabled = False
ComboBox4.Value = "0"
ComboBox4.BackColor = RGB(210, 210, 210)
ComboBox5.Enabled = False
ComboBox5.Value = "0"
ComboBox5.BackColor = RGB(210, 210, 210)
ComboBox6.Enabled = False
ComboBox6.Value = "0"
ComboBox6.BackColor = RGB(210, 210, 210)
ComboBox7.Enabled = False
ComboBox7.Value = "0"
ComboBox7.BackColor = RGB(210, 210, 210)
ComboBox8.Enabled = False
ComboBox8.Value = "0"
ComboBox8.BackColor = RGB(210, 210, 210)
ComboBox9.Enabled = False
ComboBox9.Value = "0"
ComboBox9.BackColor = RGB(210, 210, 210)
ComboBox14.Enabled = False
ComboBox14.Value = "zakelijke rit"
ComboBox14.BackColor = RGB(210, 210, 210)
ComboBox16.Enabled = True
ComboBox16.Value = ""
ComboBox16.BackColor = RGB(255, 255, 255)
TextBox1.Enabled = False
TextBox1.Value = "0"
TextBox1.BackColor = RGB(210, 210, 210)
Else
ComboBox1.Enabled = True
ComboBox1.Value = ""
ComboBox1.BackColor = RGB(255, 255, 255)
'ComboBox4.Enabled = True
'ComboBox4.Value = ""
'ComboBox4.BackColor = RGB(255, 255, 255)
'ComboBox5.Enabled = True
'ComboBox5.Value = ""
'ComboBox5.BackColor = RGB(255, 255, 255)
'ComboBox6.Enabled = True
'ComboBox6.Value = ""
'ComboBox6.BackColor = RGB(255, 255, 255)
'ComboBox7.Enabled = True
'ComboBox7.Value = ""
'ComboBox7.BackColor = RGB(255, 255, 255)
'ComboBox8.Enabled = True
'ComboBox8.Value = ""
'ComboBox8.BackColor = RGB(255, 255, 255)
'ComboBox9.Enabled = True
'ComboBox9.Value = ""
'ComboBox9.BackColor = RGB(255, 255, 255)
'ComboBox14.Enabled = True
'ComboBox14.Value = ""
'ComboBox14.BackColor = RGB(255, 255, 255)
'TextBox1.Enabled = True
'TextBox1.Value = ""
'TextBox1.BackColor = RGB(255, 255, 255)
End If
End Sub