[AccessD] Textbox special highlighting

Jim Dettman jimdettman at verizon.net
Tue Jan 3 10:33:33 CST 2012


 I did that for a while based on some code I picked up from Allen Brown's
site, but most users didn't like it.  I was adjusting the label on the fly
to indicate required vs non-required fields.

 In the end, I ended up with simply high lighting all the required controls
with a background change rather then setting/clearing when they switch from
inquiry to edit mode.

Jim. 

Private Function MarkAttachedLabel(ctl As Access.Control)

      'Author:        Allen Browne    allen at allenbrowne.com
      'Version:       21 September 2008.
      'Copyright:     None. You can use this in your database for any
purpose.
      '               We request that you acknowledge the source in your
code.
      'Documentation: http://allenbrowne.com

10    On Error GoTo Err_Handler
          'Purpose:   Bypass the error if a control has no attached label.
          
20        With ctl.Controls(0)
30            If Not .Caption Like "*[*]" Then
40                .Caption = .Caption & "*"
50                .FontBold = True
60            End If
70        End With

Exit_Handler:
80        Exit Function

Err_Handler:
90        Resume Exit_Handler
End Function

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Tuesday, January 03, 2012 10:26 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Textbox special highlighting

Doug,

It turns out that text boxes can have a label associated with it.  Every
control has a controls 
collection and *if "connected"* the label is controls(0).  Thus
txtMyCtl.Controls(0) will let you 
manipulate the label for the text box.  You can then play with the label
background color, font etc 
as you think might be useful.  I do precisely this in my framework, as I set
up a text box for a 
double click event I change the label color to a different color of blue.

Of course I have a class for this.  ;)

John W. Colby
Colby Consulting

Reality is what refuses to go away
when you do not believe in it

On 1/3/2012 9:29 AM, Jim Dettman wrote:
> Doug,
>
>    Only thing that comes to mind is using the old trick of putting a
control
> behind the control with a graphic and then setting the foreground
control's
> background as transparent.
>
>   The only wrinkle would be knowing that on these controls, you'd need to
set
> the background controls background rather then the foreground's (assuming
> you do that on the fly - if not, then it's not a problem).
>
> Jim.
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele
> Sent: Monday, January 02, 2012 07:14 PM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] Textbox special highlighting
>
> Hello all:
>
> I would like to have a consistent method of highlighting textboxes so that
> a user knows that double clicking will result in the display of more
> information.  Ideally, it wouldn't involve changing the background or
> foreground colour, as I use these with conditional formatting for
> displaying other information (order quantity is greater than on-hand
> quantity, for instance).  Changing the border colour or thickness results
> in some very ugly grid displays.
>
> The ability to put a little triangle in one corner of the textbox would be
> ideal - the way Excel does for comments.  Does anyone have a brilliant
> solution?
>
> Thanks,
> Doug

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list