LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Passing reference to a checkbox to a subroutine.

I have an application where I am trying to enable/disable the controls in a
frame on a UserForm in VBA Office 2003. I have a checkbox in the frame and
when the checkbox is clicked, based on its value, I want to call one of two
subroutines. The subroutines have two arguments: the frame and the checkbox.
Whenever I try to run this code I get a type mismatch error. I know the
default property of the checkbox is the value property. Is it possible that
when I call the subs and reference the checkbox that it is trying to send a
boolean reference instead of a reference to the actual checkbox control? If
that is the case how do I get around this? If that isn't the problem, what
is, and how do I get it to work? The code is below. Thanks.

CheckBox clicked event:
Private Sub ckbTalentMod1_Click()
If ckbTalentMod1.Value = True Then
Call EnableObjects(fraTalentMod1, ckbTalentMod1)
Else
Call DisableObjects(fraTalentMod1, ckbTalentMod1)
End If
End Sub

Subroutine to enable the controls in the frame:

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Constant Arguments to custom Subroutine & Functions cLiffordiL Excel Programming 6 June 21st 06 09:17 AM
Passing Module to subroutine SixSigmaGuy[_2_] Excel Programming 2 April 25th 06 10:59 PM
Excel vba - passing a 3-dimensional array to a subroutine [email protected] Excel Programming 5 March 28th 06 07:50 PM
How to check workbook is already opened before passing the workbook obj to a subroutine in Word Bon Excel Programming 2 January 19th 06 09:54 AM
Passing arrays to a subroutine Braden Craig Excel Programming 4 August 17th 03 05:54 PM


All times are GMT +1. The time now is 06:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"