>>>well I am trying to get around looking at all the buttons with a case
>>>statement so I was trying this.
[quoted text clipped - 25 lines]
>passing a string as the control name I assume either this is wrong or
>I am missing a library.
Neither. The error is because you have to use Set with
object valiables:
Set ctl = Me.Controls(ctlname)
Another way (preferable IMO) is to use:
Public Sub looking(ctl As OptionGroup)
Dim btn As ToggleButton
For Each btn In ctl.Controls
And call it:
looking Me.Q23Pass1Position
When calling a Sub procedure with just the procedure name,
don't use ( ) The ( ) won't work with a list of argumnets
and in your case above, they will convert the control object
to its Value property.
You do need ( ) if you call it this way:
Call looking(Me.Q23Pass1Position)
--
Marsh
sparks - 05 May 2008 14:12 GMT
Thank you very much for clearing that up for me.
Will give it a try right now.
again thanks for taking the time to explain it all.
>>>>well I am trying to get around looking at all the buttons with a case
>>>>statement so I was trying this.
[quoted text clipped - 46 lines]
>You do need ( ) if you call it this way:
> Call looking(Me.Q23Pass1Position)