PC Review


Reply
Thread Tools Rate Thread

CheckBox Ticked, ComboBoxBox visible?

 
 
hoyos
Guest
Posts: n/a
 
      17th Nov 2009
I have the following code below only works when the userform is displayed. If
I un-check the checkbox which then hides a combobox. If then close the
userform and reopen it again the combobox is visible even though the checkbox
is not ticked.
How can I get over this problem?

Private Sub CheckBox62_Change()
If CheckBox62.Value = True Then
ComboBox7.Visible = True
Label106.Visible = True
Else
CheckBox62.Value = False
ComboBox7.Visible = False
Label106.Visible = False
End If
End Sub
 
Reply With Quote
 
 
 
 
om
Guest
Posts: n/a
 
      17th Nov 2009
Hi hoyos

add following to your code

Private Sub UserForm_Initialize()
ComboBox7.Visible = False
Label106.Visible = False
End Sub

Regards
Om

"hoyos" wrote:

> I have the following code below only works when the userform is displayed. If
> I un-check the checkbox which then hides a combobox. If then close the
> userform and reopen it again the combobox is visible even though the checkbox
> is not ticked.
> How can I get over this problem?
>
> Private Sub CheckBox62_Change()
> If CheckBox62.Value = True Then
> ComboBox7.Visible = True
> Label106.Visible = True
> Else
> CheckBox62.Value = False
> ComboBox7.Visible = False
> Label106.Visible = False
> End If
> End Sub

 
Reply With Quote
 
hoyos
Guest
Posts: n/a
 
      17th Nov 2009
Many thanks OM that works well.

"om" wrote:

> Hi hoyos
>
> add following to your code
>
> Private Sub UserForm_Initialize()
> ComboBox7.Visible = False
> Label106.Visible = False
> End Sub
>
> Regards
> Om
>
> "hoyos" wrote:
>
> > I have the following code below only works when the userform is displayed. If
> > I un-check the checkbox which then hides a combobox. If then close the
> > userform and reopen it again the combobox is visible even though the checkbox
> > is not ticked.
> > How can I get over this problem?
> >
> > Private Sub CheckBox62_Change()
> > If CheckBox62.Value = True Then
> > ComboBox7.Visible = True
> > Label106.Visible = True
> > Else
> > CheckBox62.Value = False
> > ComboBox7.Visible = False
> > Label106.Visible = False
> > End If
> > End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extend date after checkbox ticked Caroline Higson Microsoft Access 2 14th Nov 2006 11:12 PM
Add value when checkbox is ticked emel24 Microsoft Excel Programming 7 29th Jun 2006 10:21 AM
Checkbox: jump to next field when ticked =?Utf-8?B?YW5jaWVudF9oaWxseQ==?= Microsoft Access Forms 2 12th Aug 2005 06:58 PM
VBA for put cell C2 in overstrike/black when B2 checkbox is ticked? StargateFan Microsoft Excel Programming 1 14th Feb 2005 02:28 PM
Master-Detail Datagrid -checkbox (once tick the checkbox, all the child checkbox is ticked) Agnes Microsoft VB .NET 0 16th Aug 2004 11:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:10 PM.