View Single Post
 
Old 06-02-2014, 08:09 AM
BobBridges's Avatar
BobBridges BobBridges is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Quote:
Originally Posted by Bob Bridges
I think I'd try passing the checkbox object itself.
Quote:
Originally Posted by NobodysPerfect
If that means
Code:
Private Sub CB1a_Click
  Call DoWithBox "CB1a"...
Nope, that's just another way of trying to pass the name of the checkbox. I think this would work:

Code:
Private Sub CB1a_Click
  DoWithBox CB1a
  .
  .
  .
Then in DoWithBox something like
Code:
Sub DoWithBox(cb)
  Select Case cb.Name
    Case "CB1a": 'do whatever
    Case "CB1b": 'do something else
    Case "CB2a": 'and so on
    End Select
  .
  .
  .
I'm not saying that's the way I'd solve the original problem; but if I'd already decided to try to work based on the object name, then this is probably how I'd go about doing that.

Is there a way for a control in the form to refer to itself? I think "Me" refers to the whole form, but maybe some object named "ThisControl" or something? Might simplify coding.
Reply With Quote