473,804 Members | 3,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checkboxes and Option Groups

How can the label for a checkbox and the labels for the options in an option
group be addressed? When a checkbox gets the focus, Access draws a dotted
box around the label. When an option group gets the focus, Access draws a
dotted box around the label of the first option or the label of the option
previously selected. I would like to change the backcolor of these labels to
yellow as the controls get focus.

For textboxes and comboboxes I have a function with the following code:
Function HiLiteControl()
Screen.ActiveCo ntrol.Backcolor = "8454143"
End Function

And I put the following in the GotFocus event of all the textboxes and
comboboxes:
=HiLiteControl( )

I would like to be able to do something similar for the label for a checkbox
and the labels for the options in an option group.

Thanks!

Steve
Nov 13 '05 #1
20 5167
Br
PC Datasheet wrote:
How can the label for a checkbox and the labels for the options in an
option group be addressed? When a checkbox gets the focus, Access
draws a dotted box around the label. When an option group gets the
focus, Access draws a dotted box around the label of the first option
or the label of the option previously selected. I would like to
change the backcolor of these labels to yellow as the controls get
focus.
For textboxes and comboboxes I have a function with the following
code: Function HiLiteControl()
Screen.ActiveCo ntrol.Backcolor = "8454143"
End Function

And I put the following in the GotFocus event of all the textboxes and
comboboxes:
=HiLiteControl( )

I would like to be able to do something similar for the label for a
checkbox and the labels for the options in an option group.

Thanks!

Steve


I'd pass the control name to your function on each control's OnFocus
event. If it's an option group or something just pass the label's name
instead of the control?

eg. (something like this....)

Private Function HiLiteControl(p MyControl as Control)
pMyControl.Back Color = "8454143"
End Function

Private Sub txtMyTextBox_On Focus()
HiLiteControl Me![txtMyTextBox]
End Sub

Their's probably a dozen ways of achieving this.

Also, how are you resetting the color when the control looses the focus?
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 13 '05 #2
rkc
PC Datasheet wrote:
How can the label for a checkbox and the labels for the options in an option
group be addressed? When a checkbox gets the focus, Access draws a dotted
box around the label. When an option group gets the focus, Access draws a
dotted box around the label of the first option or the label of the option
previously selected. I would like to change the backcolor of these labels to
yellow as the controls get focus.

For textboxes and comboboxes I have a function with the following code:
Function HiLiteControl()
Screen.ActiveCo ntrol.Backcolor = "8454143"
End Function

And I put the following in the GotFocus event of all the textboxes and
comboboxes:
=HiLiteControl( )

I would like to be able to do something similar for the label for a checkbox
and the labels for the options in an option group.


With checkboxes you can use Screen.ActiveCo ntrol.Controls( 0).
The attached label is a 'child' of the combobox.

With Option Groups it's not so easy because the active control is the
Frame the option buttons are contained by.

Using Screen.ActiveCo ntrol in the LostFocus event to reset the
background is a runtime error waiting to happen. Clicking outside
the current form is one way to increase the odds of throwing an error.

Take Br@dley's advice. Ditch Screen.ActiveCo ntrol and write a function
that takes a control as an argument.

I'll wave my fee.


Nov 13 '05 #3
Bradley,

Thanks for responding!

I'm looking for a way to do something like screen.ActiveLa bel so I can put
the same expression (=HiLiteLabel() ) in the GotFocus event code line for all
the checkboxes and option groups.

I use the same process in the LostFocus event to reset the color using
backcolor of 16777215.

Steve
"Br@dley" <br*****@usenet .com> wrote in message
news:Kt******** ***********@new s-server.bigpond. net.au...
PC Datasheet wrote:
How can the label for a checkbox and the labels for the options in an
option group be addressed? When a checkbox gets the focus, Access
draws a dotted box around the label. When an option group gets the
focus, Access draws a dotted box around the label of the first option
or the label of the option previously selected. I would like to
change the backcolor of these labels to yellow as the controls get
focus.
For textboxes and comboboxes I have a function with the following
code: Function HiLiteControl()
Screen.ActiveCo ntrol.Backcolor = "8454143"
End Function

And I put the following in the GotFocus event of all the textboxes and
comboboxes:
=HiLiteControl( )

I would like to be able to do something similar for the label for a
checkbox and the labels for the options in an option group.

Thanks!

Steve


I'd pass the control name to your function on each control's OnFocus
event. If it's an option group or something just pass the label's name
instead of the control?

eg. (something like this....)

Private Function HiLiteControl(p MyControl as Control)
pMyControl.Back Color = "8454143"
End Function

Private Sub txtMyTextBox_On Focus()
HiLiteControl Me![txtMyTextBox]
End Sub

Their's probably a dozen ways of achieving this.

Also, how are you resetting the color when the control looses the focus?
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response

Nov 13 '05 #4
Thanks for replying!

< Using Screen.ActiveCo ntrol in the LostFocus event to reset the background
is a runtime error waiting to happen. >
Why?

If I write a function that takes a control as an argument, I have to pass a
different control name at each call of the function. Is there a way to avoid
that. Screen.ActiveCo ntrol avoids that for textboxes and comboboxes and
that's why I use it. When I posted the question I was hoping to find
something like Screen.ActiveCo ntrol.Label.

Steve
"rkc" <rk*@rochester. yabba.dabba.do. rr.bomb> wrote in message
news:7k******** ***********@twi ster.nyroc.rr.c om...
PC Datasheet wrote:
How can the label for a checkbox and the labels for the options in an
option group be addressed? When a checkbox gets the focus, Access draws a
dotted box around the label. When an option group gets the focus, Access
draws a dotted box around the label of the first option or the label of
the option previously selected. I would like to change the backcolor of
these labels to yellow as the controls get focus.

For textboxes and comboboxes I have a function with the following code:
Function HiLiteControl()
Screen.ActiveCo ntrol.Backcolor = "8454143"
End Function

And I put the following in the GotFocus event of all the textboxes and
comboboxes:
=HiLiteControl( )

I would like to be able to do something similar for the label for a
checkbox and the labels for the options in an option group.


With checkboxes you can use Screen.ActiveCo ntrol.Controls( 0).
The attached label is a 'child' of the combobox.

With Option Groups it's not so easy because the active control is the
Frame the option buttons are contained by.

Using Screen.ActiveCo ntrol in the LostFocus event to reset the background
is a runtime error waiting to happen. Clicking outside
the current form is one way to increase the odds of throwing an error.

Take Br@dley's advice. Ditch Screen.ActiveCo ntrol and write a function
that takes a control as an argument.

I'll wave my fee.



Nov 13 '05 #5
I meant to previously ask ----

<With Option Groups it's not so easy ........>
Is it possible? How?

Thanks!

Steve
"rkc" <rk*@rochester. yabba.dabba.do. rr.bomb> wrote in message
news:7k******** ***********@twi ster.nyroc.rr.c om...
PC Datasheet wrote:
How can the label for a checkbox and the labels for the options in an
option group be addressed? When a checkbox gets the focus, Access draws a
dotted box around the label. When an option group gets the focus, Access
draws a dotted box around the label of the first option or the label of
the option previously selected. I would like to change the backcolor of
these labels to yellow as the controls get focus.

For textboxes and comboboxes I have a function with the following code:
Function HiLiteControl()
Screen.ActiveCo ntrol.Backcolor = "8454143"
End Function

And I put the following in the GotFocus event of all the textboxes and
comboboxes:
=HiLiteControl( )

I would like to be able to do something similar for the label for a
checkbox and the labels for the options in an option group.


With checkboxes you can use Screen.ActiveCo ntrol.Controls( 0).
The attached label is a 'child' of the combobox.

With Option Groups it's not so easy because the active control is the
Frame the option buttons are contained by.

Using Screen.ActiveCo ntrol in the LostFocus event to reset the background
is a runtime error waiting to happen. Clicking outside
the current form is one way to increase the odds of throwing an error.

Take Br@dley's advice. Ditch Screen.ActiveCo ntrol and write a function
that takes a control as an argument.

I'll wave my fee.



Nov 13 '05 #6
rkc <rk*@rochester. yabba.dabba.do. rr.bomb> wrote:
: PC Datasheet wrote:

<snip any substance>

: I'll wave my fee.

So it seems that you're not going to waive your fee -- otherwise
you'll have nothing to wave.

sorry, I couldn't resist such a good bad pun.
--thelma


Nov 13 '05 #7

"Thelma Lubkin" <th****@alpha2. csd.uwm.edu> wrote in message
news:di******** **@uwm.edu...
rkc <rk*@rochester. yabba.dabba.do. rr.bomb> wrote:
: PC Datasheet wrote:

<snip any substance>

: I'll wave my fee.

So it seems that you're not going to waive your fee -- otherwise
you'll have nothing to wave.

sorry, I couldn't resist such a good bad pun.
--thelma

That's ok, PC always has a problem with spelling. He just does not have a
good dictionary.
(and forgets these newsgroups are for free help)

John... Visio MVP
Nov 13 '05 #8
Once again you demonstrate your intelligence! MVP must come in a crackerjack
box!

< I'll wave my fee.>
These were rkc's words not mine.

Is this why you have tried to reverse what you said 6 times in the last few
days.

Checkmate!

You lose.

BTW, did you ever look up metaphor?

Steve

"John Marshall, MVP" <la******@stone henge.ca> wrote in message
news:ex******** ******@TK2MSFTN GP12.phx.gbl...

"Thelma Lubkin" <th****@alpha2. csd.uwm.edu> wrote in message
news:di******** **@uwm.edu...
rkc <rk*@rochester. yabba.dabba.do. rr.bomb> wrote:
: PC Datasheet wrote:

<snip any substance>

: I'll wave my fee.

So it seems that you're not going to waive your fee -- otherwise
you'll have nothing to wave.

sorry, I couldn't resist such a good bad pun.
--thelma

That's ok, PC always has a problem with spelling. He just does not have a
good dictionary.
(and forgets these newsgroups are for free help)

John... Visio MVP

Nov 13 '05 #9
If you know what form all this is happening in, you should
use formobject.Acti veControl instead of the Screen object.
The Screen object covers too much territory.

I'm not convinced that I know where the focus is during the
LostFocus event, you may want to explore using the Exit
event instead.

The last item clicked on in an option group has the
OptionValue that matches the frame's Value.

Since label controls can not receive the focus, there is no
such thing as an active label. This means that the only
thing that knows an unattached label was clicked on is the
label's Click event procedure.

Clicking on an attached label moves the focus to the control
the label is attached to, so the label never gets involved.
As rkc said, you can get to the attached label using the
ActiveControl's Controls collection. All the control in an
option group are in the frame's Controls collection.
--
Marsh
MVP [MS Access]
PC Datasheet wrote:
< Using Screen.ActiveCo ntrol in the LostFocus event to reset the background
is a runtime error waiting to happen. >
Why?

If I write a function that takes a control as an argument, I have to pass a
different control name at each call of the function. Is there a way to avoid
that. Screen.ActiveCo ntrol avoids that for textboxes and comboboxes and
that's why I use it. When I posted the question I was hoping to find
something like Screen.ActiveCo ntrol.Label.
"rkc" wrote
PC Datasheet wrote:
How can the label for a checkbox and the labels for the options in an
option group be addressed? When a checkbox gets the focus, Access draws a
dotted box around the label. When an option group gets the focus, Access
draws a dotted box around the label of the first option or the label of
the option previously selected. I would like to change the backcolor of
these labels to yellow as the controls get focus.

For textboxes and comboboxes I have a function with the following code:
Function HiLiteControl()
Screen.ActiveCo ntrol.Backcolor = "8454143"
End Function

And I put the following in the GotFocus event of all the textboxes and
comboboxes:
=HiLiteControl( )

I would like to be able to do something similar for the label for a
checkbox and the labels for the options in an option group.


With checkboxes you can use Screen.ActiveCo ntrol.Controls( 0).
The attached label is a 'child' of the combobox.

With Option Groups it's not so easy because the active control is the
Frame the option buttons are contained by.

Using Screen.ActiveCo ntrol in the LostFocus event to reset the background
is a runtime error waiting to happen. Clicking outside
the current form is one way to increase the odds of throwing an error.

Take Br@dley's advice. Ditch Screen.ActiveCo ntrol and write a function
that takes a control as an argument.


Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2996
by: Gary | last post by:
Hello, Is it possible to dynamically update a textbox with words chosen from a list using form checkboxes and javascript? Gary
3
2019
by: Ondernemer | last post by:
Hi guys, On my page I dynamically create different checkboxes. <input type="checkbox" name="ch1" value="some value"> option 1 <input type="checkbox" name="ch2" value="some value"> option 2 <input type="checkbox" name="ch3" value="some value"> option 3 <input type="checkbox" name="ch4" value="some value"> option 4 The reason they have different names is because of a different script which
3
1674
by: Toboja | last post by:
Hello, I have two select lists: Available Sort Options and Selected Sort Options. The user clicks on any of the available sort options and can move them to the selected sort options box. I use the typical MoveOption javascript functions to achieve this. I need to enable the user to also decide whether they want to also subtotal using any of the options in the selected sort box. I thought that it would be nice to be able to add a checkbox...
1
1555
by: SC G | last post by:
Hi, I use a web application that has 120 checkboxes on it for me to select from before I submit a form. I have to select boxes in groups of 40 (1-40,41-80,81-120). Each submission generates a download of a data file. After I submit the form for each group I move on to another page with another 120 checkboxes to choose from. And there are hundreds of pages. Since I use
6
2255
by: BerkshireGuy | last post by:
I need to create a query that will filter out records based on records. There can be many combinations depending of what the uses selects. For instance: Field: Telemed - This is a Y or N field. It is either a Telemed or it isnt.
1
1810
by: Kasapo | last post by:
Hello, I am currently working on a website in which I have checkboxes to select attendance for brainstorming sessions. Currently, you can select multiple checkboxes, but the last one I want to be an option to not attend any sessions. The problem is that I want to deselect or otherwise 'invalidate' the checks on the previous checkboxes if the user checks the last one. Is there anyway to do this? I'm running an AMP server and would prefer not to...
1
1514
by: prash.marne | last post by:
hi , i am having a simple form ----------------------------------------------------------------------- ----------------------------------------------------------------------- -------------- <form action="submit.php" method="POST"> <select name="activity" onchange="if(this.options.value=='M')
2
6806
by: forbes | last post by:
Hi, I have a form that contains multiple groups of checkboxes that act like radio buttons (at the clients insistance). There is one text field that is required and 28 checkbox groups. Here an example of a checkbox group: <td><input type="checkbox" name="trusted" value="1" id="ck_ttt1" onclick="... <td><input type="checkbox" name="trusted" value="2" id="ck_ttt2"
1
2248
by: zufie | last post by:
I have a main form containing 2 checkboxes. The respective checkboxes when checked cause the SepcialEffect Property to make all the textboxes to appear Shadowed. 1)Although the Textboxes and Combo Boxes required to appear Shadowed are almost the same regardless of the checkbox that is checked how do I cause individual textboxes to appear Flat? 2)How do I cause the Textboxes and Combo Boxes to highlight upon
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9157
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3821
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2993
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.