Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2006

Tip: Looking for answers? Try searching our database.

Common routine to handle a check box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike News - 21 Feb 2006 00:03 GMT
I have a checkbox on a userform, and in a procedure I want to

make the checkbox invisible and
set it to false

Sub blob(x As CheckBox)
   x.Visible = False
   x = False
End Sub

So I have the above routine, but when am I calling it, how do I call
blob
blob(checkbox1) doesn't work because it's pass the value in I think
which is a boolean, and not of type checkbox
Signature

Mike

Bob Phillips - 21 Feb 2006 00:16 GMT
Here is an example

Private Sub CommandButton1_Click()
   blob Me.CheckBox1
End Sub

Private Sub blob(cb As MSForms.CheckBox)
   MsgBox cb.Name
End Sub

This passes the object, not just one property, so you can access those
properties from within blob.

Signature

HTH

Bob Phillips

(remove nothere from email address if mailing direct)

> I have a checkbox on a userform, and in a procedure I want to
>
[quoted text clipped - 10 lines]
> blob(checkbox1) doesn't work because it's pass the value in I think
> which is a boolean, and not of type checkbox
Mike News - 21 Feb 2006 08:52 GMT
>Here is an example
>
[quoted text clipped - 8 lines]
>This passes the object, not just one property, so you can access those
>properties from within blob.

Thanks.  I'd read about using Me from within the event on a checkbox,
but thought that referred to the object and not the whole userform

Many thanks
Signature

Mike

Bob Phillips - 21 Feb 2006 10:18 GMT
Me generally refers to the containing object, so it is the Userform in
userform code module, the worksheet in that sheet code module, and the
workbook in ThisWorkbook.

Signature

HTH

Bob Phillips

(remove nothere from email address if mailing direct)

> >Here is an example
> >
[quoted text clipped - 13 lines]
>
> Many thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.