I have code on GetFocus for the toggle button.
When I check my fucntion Screen.ActiveControl.Name shows my frame
name, but not my toggle button name.
Are there any way to get Screen.ActiveControl.Name for toggle button
on the frame?
Your help is great appreciated,
As you found, the option group is the active control, not the buttons it
contains. You can examine the Value of the group, and compare it to the
OptionValue of the buttons if you want to match them.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"iccsi" <inu...@gmail.com> wrote in message
news:d63feb1b-a790-491f...@m74g2000hsh.googlegroups.com...
Thanks for helping,
I have many frame in the form and to udpate my physical table when
user click.
Because there are 10 frames on the form and 30 toggle buttons on the
form, each frame has 3 toggle button.
I just wanted to have a general function to handle all the toggle
button.
I pass the control to the function, but the funciton only recieve
frame name.
Are there any work around for this?
Thanks millions,
You create a table with a field of type Number.
You create a form with an option group bound to the Number field.
When the user depresses a toggle button, that becomes the value of the
option group. Access than saves this number into the Number field. No
handling is necessary.
If you need to do something else, please let us know. One fairly common
approach might be to create a small lookup table with 2 fields like this:
SomeID Number
SomeDescrip Text
You can then add a record for each button in your option group. The number
matches the button's OptionValue, and the description explains what this
number means. Doing this, you can include this table in a query, and so the
description onto your report.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"iccsi" <inu...@gmail.com> wrote in message
news:86dd6b4d-43e1-41b6...@25g2000hsk.googlegroups.com...
On Oct 7, 10:57 am, "Allen Browne" <AllenBro...@SeeSig.Invalid> wrote:
> What are you trying to do?
>
> As you found, the option group is the active control, not the buttons it
> contains. You can examine the Value of the group, and compare it to the
> OptionValue of the buttons if you want to match them.
>
Thanks for helping,
I use unbound form, so I need update table by myself.
Thanks again,
I tried to use one function to handle 30 toggle buttons on 10 frames
for unbound form, since I need take care of update, insert, delete by
VBA code.
Is it possible to have one function to handle the situation?
It probably is.
But it would make much more sense to use a bound form.
(Even if you did know how to write the code.)
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Thanks for helping,
Understood.
The problem is the whole application started as unbound form.
It takes more time to do this part as bound form.
I just realized that how imprtant of application design.
I found a solution to use onExit on the frame then access the value ot
the frame from my function and create a macro to call the function.
In the form just fill the macro name then I have one function to take
care 30 toggle buttons on 10 frames.
This case I only have one function to maintain.
Thanks again,