Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 13th, 2005, 09:58 AM
Armando
Guest
 
Posts: n/a
Default Attaching a label to a BOX

Hey gurus -

Access 2000 - I have a form with a series of box controls forming a map of
clickable areas, and I want each one to have a label. No problem, just put
'em on, right? But I also want the box/label combination to act as a single
item when clicked - that is, not have to put the same OnClick code on both
the box and the label (or force the user to click on the background only).
I've tried attaching the label to the box (by cutting the label then
highlighting the box and pasting it) to try to make the text clickable, like
checkboxes and option buttons work, but they don't stick together.

I can't make the boxes into command buttons, because I need to set the
bgcolor of each one to show its status. I suppose I could use cb's with
colored captions, but it's not as visually intuitive.

Ideas?

Armando


  #2  
Old November 13th, 2005, 09:59 AM
B. Austin
Guest
 
Posts: n/a
Default Re: Attaching a label to a BOX

Armando -

This is a trick that works in Access 97 and probably A2K also.

Highlight the label and cut it to the clipboard (Ctl-X). Then highlight the control and paste
(Ctl-V).

The label will come back and will be attached to the control that you highlighted.

- Brian
[color=blue]
>Hey gurus -
>
>Access 2000 - I have a form with a series of box controls forming a map of
>clickable areas, and I want each one to have a label. No problem, just put
>'em on, right? But I also want the box/label combination to act as a single
>item when clicked - that is, not have to put the same OnClick code on both
>the box and the label (or force the user to click on the background only).
>I've tried attaching the label to the box (by cutting the label then
>highlighting the box and pasting it) to try to make the text clickable, like
>checkboxes and option buttons work, but they don't stick together.
>
>I can't make the boxes into command buttons, because I need to set the
>bgcolor of each one to show its status. I suppose I could use cb's with
>colored captions, but it's not as visually intuitive.
>
>Ideas?
>
>Armando
>[/color]

(Remove NOSPAM to reply.)
  #3  
Old November 13th, 2005, 09:59 AM
B. Austin
Guest
 
Posts: n/a
Default Re: Attaching a label to a BOX

Armando -

Sorry for the wasted post, I overlooked the last sentence of your first paragraph. Apparently
rectangle controls don't know about labels...

- Brian
[color=blue][color=green]
>>Hey gurus -
>>
>>Access 2000 - I have a form with a series of box controls forming a map of
>>clickable areas, and I want each one to have a label. No problem, just put
>>'em on, right? But I also want the box/label combination to act as a single
>>item when clicked - that is, not have to put the same OnClick code on both
>>the box and the label (or force the user to click on the background only).
>>I've tried attaching the label to the box (by cutting the label then
>>highlighting the box and pasting it) to try to make the text clickable, like
>>checkboxes and option buttons work, but they don't stick together.
>>
>>I can't make the boxes into command buttons, because I need to set the
>>bgcolor of each one to show its status. I suppose I could use cb's with
>>colored captions, but it's not as visually intuitive.
>>
>>Ideas?
>>
>>Armando
>>[/color]
>
>(Remove NOSPAM to reply.)[/color]

(Remove NOSPAM to reply.)
  #4  
Old November 13th, 2005, 09:59 AM
Justin Hoffman
Guest
 
Posts: n/a
Default Re: Attaching a label to a BOX


"Armando" <armando@bogusaddress.com> wrote in message
news:KwW7e.1061$4a.101279@news1.epix.net...[color=blue]
> Hey gurus -
>
> Access 2000 - I have a form with a series of box controls forming a map of
> clickable areas, and I want each one to have a label. No problem, just
> put
> 'em on, right? But I also want the box/label combination to act as a
> single
> item when clicked - that is, not have to put the same OnClick code on both
> the box and the label (or force the user to click on the background only).
> I've tried attaching the label to the box (by cutting the label then
> highlighting the box and pasting it) to try to make the text clickable,
> like
> checkboxes and option buttons work, but they don't stick together.
>
> I can't make the boxes into command buttons, because I need to set the
> bgcolor of each one to show its status. I suppose I could use cb's with
> colored captions, but it's not as visually intuitive.
>
> Ideas?
>
> Armando[/color]


Here is one possibilty to handle this sort of thing - this form has two
box/label combinations:

Private Sub HandleClick(strBox As String)

Select Case strBox

Case "One"
MsgBox "Do this!"

Case "Two"
MsgBox "Do that!"

Case Else
MsgBox "Do what?"

End Select

End Sub

Private Sub boxOne_Click()
HandleClick "One"
End Sub

Private Sub lblOne_Click()
HandleClick "One"
End Sub

Private Sub boxTwo_Click()
HandleClick "Two"
End Sub

Private Sub lblTwo_Click()
HandleClick "Two"
End Sub


  #5  
Old November 13th, 2005, 09:59 AM
Phil Stanton
Guest
 
Posts: n/a
Default Re: Attaching a label to a BOX

Have a look at Stephen Lebans (http://www.lebans.com) cmdbutton. As far as I
remember that allows coloured command buttons with labels

HTH

Phil


"Armando" <armando@bogusaddress.com> wrote in message
news:KwW7e.1061$4a.101279@news1.epix.net...[color=blue]
> Hey gurus -
>
> Access 2000 - I have a form with a series of box controls forming a map of
> clickable areas, and I want each one to have a label. No problem, just
> put
> 'em on, right? But I also want the box/label combination to act as a
> single
> item when clicked - that is, not have to put the same OnClick code on both
> the box and the label (or force the user to click on the background only).
> I've tried attaching the label to the box (by cutting the label then
> highlighting the box and pasting it) to try to make the text clickable,
> like
> checkboxes and option buttons work, but they don't stick together.
>
> I can't make the boxes into command buttons, because I need to set the
> bgcolor of each one to show its status. I suppose I could use cb's with
> colored captions, but it's not as visually intuitive.
>
> Ideas?
>
> Armando
>
>[/color]


  #6  
Old November 13th, 2005, 09:59 AM
Armando
Guest
 
Posts: n/a
Default Re: Attaching a label to a BOX

Hi Justin -

Yup, this is exactly what I'm doing now, just send the same call from both
the box and the label, then do the actual work in the called sub, after
deciding what was clicked. I was hoping to get this down to a single call
from each box, mostly to make it more generalizable for users who have a
different physical-metaphor map. But this isn't THAT bad - thanks for the
second opinion.

Armando

"Justin Hoffman" <j@b.com> wrote in message
news:d3qefg$n7o$1@hercules.btinternet.com...[color=blue]
>
> "Armando" <armando@bogusaddress.com> wrote in message
> news:KwW7e.1061$4a.101279@news1.epix.net...[color=green]
> > Hey gurus -
> >
> > Access 2000 - I have a form with a series of box controls forming a map[/color][/color]
of[color=blue][color=green]
> > clickable areas, and I want each one to have a label. No problem, just
> > put
> > 'em on, right? But I also want the box/label combination to act as a
> > single
> > item when clicked - that is, not have to put the same OnClick code on[/color][/color]
both[color=blue][color=green]
> > the box and the label (or force the user to click on the background[/color][/color]
only).[color=blue][color=green]
> > I've tried attaching the label to the box (by cutting the label then
> > highlighting the box and pasting it) to try to make the text clickable,
> > like
> > checkboxes and option buttons work, but they don't stick together.
> >
> > I can't make the boxes into command buttons, because I need to set the
> > bgcolor of each one to show its status. I suppose I could use cb's with
> > colored captions, but it's not as visually intuitive.
> >
> > Ideas?
> >
> > Armando[/color]
>
>
> Here is one possibilty to handle this sort of thing - this form has two
> box/label combinations:
>
> Private Sub HandleClick(strBox As String)
>
> Select Case strBox
>
> Case "One"
> MsgBox "Do this!"
>
> Case "Two"
> MsgBox "Do that!"
>
> Case Else
> MsgBox "Do what?"
>
> End Select
>
> End Sub
>
> Private Sub boxOne_Click()
> HandleClick "One"
> End Sub
>
> Private Sub lblOne_Click()
> HandleClick "One"
> End Sub
>
> Private Sub boxTwo_Click()
> HandleClick "Two"
> End Sub
>
> Private Sub lblTwo_Click()
> HandleClick "Two"
> End Sub
>
>[/color]


  #7  
Old November 13th, 2005, 09:59 AM
Armando
Guest
 
Posts: n/a
Default Re: Attaching a label to a BOX

Phil -

This always seems to be the answer to questions like this, and I STILL
forget to do it first. Thanks, I'll look there.

Armando

"Phil Stanton" <philnoxx@xxstantonfamily.co.uk> wrote in message
news:4260f0c6$0$556$ed2e19e4@ptn-nntp-reader04.plus.net...[color=blue]
> Have a look at Stephen Lebans (http://www.lebans.com) cmdbutton. As far as[/color]
I[color=blue]
> remember that allows coloured command buttons with labels
>
> HTH
>
> Phil[/color]



 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles