Connecting Tech Pros Worldwide Forums | Help | Site Map

How to get properties of option button?

Adrian
Guest
 
Posts: n/a
#1: Nov 12 '05
Access 2000

How can I get the properties of the selected option button within an option
group?

With the code below it returns the 'HelpcontextID) of the option group, and
not the ID associated with the selected button.

Me.ActiveControl.Properties("HelpcontextId")

Thanks for any help.

Adrian



Wayne Morgan
Guest
 
Posts: n/a
#2: Nov 12 '05

re: How to get properties of option button?


Since you are using ActiveControl, I'm guessing that this is a generic piece
of code that gets called when the user presses F1. If that is the case, it
would probably be a lot easier to just include all of the options in that
help page or have the option group call a page with links that take you to
each of the options.

--
Wayne Morgan
MS Access MVP


"Adrian" <nospam@hotmail.com> wrote in message
news:bv5bvn$r64$1$8302bc10@news.demon.co.uk...[color=blue]
> Access 2000
>
> How can I get the properties of the selected option button within an[/color]
option[color=blue]
> group?
>
> With the code below it returns the 'HelpcontextID) of the option group,[/color]
and[color=blue]
> not the ID associated with the selected button.
>
> Me.ActiveControl.Properties("HelpcontextId")
>
> Thanks for any help.
>
> Adrian
>
>[/color]


Adrian
Guest
 
Posts: n/a
#3: Nov 12 '05

re: How to get properties of option button?


Wayne,

Thanks for your reply.
[color=blue][color=green]
>> have the option group call a page with links[/color][/color]

That was my fallback strategy! But I had hoped it would not be too difficult
to take the user directly to the correct help page.

Adrian.

"Wayne Morgan" <comprev_gothroughthenewsgroup@hotmail.com> wrote in message
news:MyrRb.11688$cg6.4638@newssvr23.news.prodigy.c om...[color=blue]
> Since you are using ActiveControl, I'm guessing that this is a generic[/color]
piece[color=blue]
> of code that gets called when the user presses F1. If that is the case, it
> would probably be a lot easier to just include all of the options in that
> help page or have the option group call a page with links that take you to
> each of the options.
>
> --
> Wayne Morgan
> MS Access MVP
>
>
> "Adrian" <nospam@hotmail.com> wrote in message
> news:bv5bvn$r64$1$8302bc10@news.demon.co.uk...[color=green]
> > Access 2000
> >
> > How can I get the properties of the selected option button within an[/color]
> option[color=green]
> > group?
> >
> > With the code below it returns the 'HelpcontextID) of the option group,[/color]
> and[color=green]
> > not the ID associated with the selected button.
> >
> > Me.ActiveControl.Properties("HelpcontextId")
> >
> > Thanks for any help.
> >
> > Adrian
> >
> >[/color]
>
>[/color]


Mike Storr
Guest
 
Posts: n/a
#4: Nov 12 '05

re: How to get properties of option button?


On Tue, 27 Jan 2004 12:17:02 -0000, Adrian wrote:

Try using the following in the AfterUpdate event of the OptionGroup. Not
entirely simple, but not all that complicated either. Remember to change
the control names to what you are using.

Dim cntrl As Control
For Each cntrl In Me!OptionGroup.Controls
If cntrl.ControlType = ac(OptionButtonType) Then
If cntrl.OptionValue = Me!OptionGroup Then
Me!OptionGroup.HelpContextId = cntrl.HelpContextId
End If
End If
Next cntrl

--
Mike Storr
veraccess.com

[color=blue]
> Wayne,
>
> Thanks for your reply.
>[color=green][color=darkred]
>>> have the option group call a page with links[/color][/color]
>
> That was my fallback strategy! But I had hoped it would not be too[/color]
difficult[color=blue]
> to take the user directly to the correct help page.
>
> Adrian.
>[/color]



Adrian
Guest
 
Posts: n/a
#5: Nov 12 '05

re: How to get properties of option button?


Mike,

Thanks very much. That works very nicely.

Any ideas of how to pass the helpcontextid for a tab (page) to the
helpcontextid for the form? I cannot find an event that fires when the
active tab changes.

Thanks again.

Adrian

"Mike Storr" <storrboy@sympatico.ca> wrote in message
news:1b2yiglqxzapi$.kaggzanorymk$.dlg@40tude.net.. .[color=blue]
> On Tue, 27 Jan 2004 12:17:02 -0000, Adrian wrote:
>
> Try using the following in the AfterUpdate event of the OptionGroup. Not
> entirely simple, but not all that complicated either. Remember to change
> the control names to what you are using.
>
> Dim cntrl As Control
> For Each cntrl In Me!OptionGroup.Controls
> If cntrl.ControlType = ac(OptionButtonType) Then
> If cntrl.OptionValue = Me!OptionGroup Then
> Me!OptionGroup.HelpContextId = cntrl.HelpContextId
> End If
> End If
> Next cntrl
>
> --
> Mike Storr
> veraccess.com
>
>[color=green]
> > Wayne,
> >
> > Thanks for your reply.
> >[color=darkred]
> >>> have the option group call a page with links[/color]
> >
> > That was my fallback strategy! But I had hoped it would not be too[/color]
> difficult[color=green]
> > to take the user directly to the correct help page.
> >
> > Adrian.
> >[/color]
>
>
>[/color]


Mike Storr
Guest
 
Posts: n/a
#6: Nov 12 '05

re: How to get properties of option button?


On Wed, 28 Jan 2004 10:47:35 GMT, Adrian wrote:

It depends on what triggers the move to a new page. The Click event applies
to each page in the tabcontrol, so you could use it to set
Me.HelpContextID = Me!TabControl.Pages("PageName").HelpContextID.
The OnChange event of the tabcontrol itself fires when the focus moves to a
different page. You can also use the Value property of the tabcontrol -
which is the selected page.
--
Mike Storr
veraccess.com

[color=blue]
> Mike,
>
> Thanks very much. That works very nicely.
>
> Any ideas of how to pass the helpcontextid for a tab (page) to the
> helpcontextid for the form? I cannot find an event that fires when the
> active tab changes.
>
> Thanks again.
>
> Adrian
>
> "Mike Storr" <storrboy@sympatico.ca> wrote in message
> news:1b2yiglqxzapi$.kaggzanorymk$.dlg@40tude.net.. .[color=green]
>> On Tue, 27 Jan 2004 12:17:02 -0000, Adrian wrote:
>>
>> Try using the following in the AfterUpdate event of the OptionGroup. Not
>> entirely simple, but not all that complicated either. Remember to change
>> the control names to what you are using.
>>
>> Dim cntrl As Control
>> For Each cntrl In Me!OptionGroup.Controls
>> If cntrl.ControlType = ac(OptionButtonType) Then
>> If cntrl.OptionValue = Me!OptionGroup Then
>> Me!OptionGroup.HelpContextId = cntrl.HelpContextId
>> End If
>> End If
>> Next cntrl
>>
>> --
>> Mike Storr
>> veraccess.com
>>
>>[color=darkred]
>>> Wayne,
>>>
>>> Thanks for your reply.
>>>
>>>>> have the option group call a page with links
>>>
>>> That was my fallback strategy! But I had hoped it would not be too[/color]
>> difficult[color=darkred]
>>> to take the user directly to the correct help page.
>>>
>>> Adrian.
>>>[/color]
>>
>>
>>[/color][/color]


Adrian
Guest
 
Posts: n/a
#7: Nov 12 '05

re: How to get properties of option button?


Mike,

Thanks for your help. That has given me some ideas to have a look at.

Adrian

"Mike Storr" <storrboy@sympatico.ca> wrote in message
news:1mv2k0l0rih5d.7zi3ygvli2kd$.dlg@40tude.net...[color=blue]
> On Wed, 28 Jan 2004 10:47:35 GMT, Adrian wrote:
>
> It depends on what triggers the move to a new page. The Click event[/color]
applies[color=blue]
> to each page in the tabcontrol, so you could use it to set
> Me.HelpContextID = Me!TabControl.Pages("PageName").HelpContextID.
> The OnChange event of the tabcontrol itself fires when the focus moves to[/color]
a[color=blue]
> different page. You can also use the Value property of the tabcontrol -
> which is the selected page.
> --
> Mike Storr
> veraccess.com
>
>[color=green]
> > Mike,
> >
> > Thanks very much. That works very nicely.
> >
> > Any ideas of how to pass the helpcontextid for a tab (page) to the
> > helpcontextid for the form? I cannot find an event that fires when the
> > active tab changes.
> >
> > Thanks again.
> >
> > Adrian
> >
> > "Mike Storr" <storrboy@sympatico.ca> wrote in message
> > news:1b2yiglqxzapi$.kaggzanorymk$.dlg@40tude.net.. .[color=darkred]
> >> On Tue, 27 Jan 2004 12:17:02 -0000, Adrian wrote:
> >>
> >> Try using the following in the AfterUpdate event of the OptionGroup.[/color][/color][/color]
Not[color=blue][color=green][color=darkred]
> >> entirely simple, but not all that complicated either. Remember to[/color][/color][/color]
change[color=blue][color=green][color=darkred]
> >> the control names to what you are using.
> >>
> >> Dim cntrl As Control
> >> For Each cntrl In Me!OptionGroup.Controls
> >> If cntrl.ControlType = ac(OptionButtonType) Then
> >> If cntrl.OptionValue = Me!OptionGroup Then
> >> Me!OptionGroup.HelpContextId = cntrl.HelpContextId
> >> End If
> >> End If
> >> Next cntrl
> >>
> >> --
> >> Mike Storr
> >> veraccess.com
> >>
> >>
> >>> Wayne,
> >>>
> >>> Thanks for your reply.
> >>>
> >>>>> have the option group call a page with links
> >>>
> >>> That was my fallback strategy! But I had hoped it would not be too
> >> difficult
> >>> to take the user directly to the correct help page.
> >>>
> >>> Adrian.
> >>>
> >>
> >>
> >>[/color][/color]
>
>[/color]


Closed Thread