Connecting Tech Pros Worldwide Help | Site Map

'odd' colour request

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 03:44 PM
Lapchien
Guest
 
Posts: n/a
Default 'odd' colour request

One of my users has asked that a form change it's colour if a particular
yes/no box is ticked - possibly made a bit more tricky because the form is
tabular..?


Thanks,
Lap



  #2  
Old November 12th, 2005, 03:44 PM
Joerg Glissmann
Guest
 
Posts: n/a
Default Re: 'odd' colour request

On Fri, 21 Nov 2003 07:52:44 -0000, Lapchien
<cc8345@nospamplease.eclipse.co.uk> wrote:
[color=blue]
> One of my users has asked that a form change it's colour if a particular
> yes/no box is ticked - possibly made a bit more tricky because the form
> is
> tabular..?
>
>
> Thanks,
> Lap[/color]

Hi Lap,

easy one.. Put into the code that is being executed when the yes/no box is
being something like

Me.MySectionName.BackColor = 12632256

Where "Me" refers to your form,
"MySectionName" is the name of the section of which you want to change the
colour
(There are a couple of standard ones, but I don't know what they're called
in english,
there's header, footer and detail area. You can see them in the edit mode
of a form as grey bars across the form).
".Backcolor" is the property of the section you change
and the number is the code of the colour.
You can find out the colour code if you open the properties window for a
section and klick to the right of the background color field..

HTH,

Joerg

--
Joerg Glissmann

remove pants to reply..
  #3  
Old November 12th, 2005, 03:44 PM
Trevor Best
Guest
 
Posts: n/a
Default Re: 'odd' colour request

On Fri, 21 Nov 2003 07:52:44 -0000 in comp.databases.ms-access,
"Lapchien" <cc8345@nospamplease.eclipse.co.uk> wrote:
[color=blue]
>One of my users has asked that a form change it's colour if a particular
>yes/no box is ticked - possibly made a bit more tricky because the form is
>tabular..?[/color]

By tabular you mean datasheet or continuous forms?

If datasheet then you're out of luck.

If continuous forms I assume you want different background colours on
different rows?

Create a textbox with no label, make it a big mutha that spans the
whole form, set it's controlsource proeprty to something like:

=IIf([MyCheckBox],String(30,103),"")

Set it's font to Webdings, size large enough to fill the whole lot.
Set it's *forecolor* property to the colour you want the back of your
form for when the checkbox is checked and backcolor to whatever you
want for normal (or make it transparent to inherit the form's
backcolor).

Use format menu, send to back.

--
A)bort, R)etry, I)nfluence with large hammer.
  #4  
Old November 12th, 2005, 03:44 PM
Lyle Fairfield
Guest
 
Posts: n/a
Default Re: 'odd' colour request

Trevor Best <bouncer@localhost> wrote in
news:ervrrvggfdcq98kjadjjdllgjc31ksolsh@4ax.com:
[color=blue]
> On Fri, 21 Nov 2003 07:52:44 -0000 in comp.databases.ms-access,
> "Lapchien" <cc8345@nospamplease.eclipse.co.uk> wrote:
>[color=green]
>>One of my users has asked that a form change it's colour if a particular
>>yes/no box is ticked - possibly made a bit more tricky because the form
>>is tabular..?[/color]
>
> By tabular you mean datasheet or continuous forms?
>
> If datasheet then you're out of luck.[/color]

Have you tried this with a continous form - datasheet form?

Private Sub Form_Click()
Me.DatasheetBackColor = vbRed Xor Me.DatasheetBackColor
End Sub

"Clicking" the form can be accomplished by clicking a record selector.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
  #5  
Old November 12th, 2005, 03:45 PM
Roger
Guest
 
Posts: n/a
Default Re: 'odd' colour request

does this work ?
Me.Detail.BackColor = 255
Me.FormHeader.BackColor = 255
Me.FormFooter.BackColor = 255

or you can greater a 'grey' picture and a 'red' picture and change the
form's picture .....

"Lapchien" <cc8345@nospamplease.eclipse.co.uk> wrote in message news:<1069401143.621813@ananke.eclipse.net.uk>...[color=blue]
> One of my users has asked that a form change it's colour if a particular
> yes/no box is ticked - possibly made a bit more tricky because the form is
> tabular..?
>
>
> Thanks,
> Lap[/color]
  #6  
Old November 12th, 2005, 03:45 PM
Ryan
Guest
 
Posts: n/a
Default Re: 'odd' colour request

It's quite easy to do actually. Do this in the 'After Update' event of
the tick box so that when it changes, you work out what value it holds
and then assign the colour to the form accordingly.

The colour will be a numeric value. If you change the background
colour manually you should see what these values are. e.g 255 = Red.

If it's tabular, you can set the tab control to be transparent and
then change the colour of the underlying form. Alternatively you may
be able to change to change each tab. Would need to look to confirm
this to be honest.

The only thing that won't change on the tabs is the control at the top
of the tab form. It always stays that boring old grey. I had enough of
this on an app I wrote a while back, so dropped the use of tabbed
screens (in this format) and found a better looking way of approaching
it. Depends how adventurous you are feeling.

"Lapchien" <cc8345@nospamplease.eclipse.co.uk> wrote in message news:<1069401143.621813@ananke.eclipse.net.uk>...[color=blue]
> One of my users has asked that a form change it's colour if a particular
> yes/no box is ticked - possibly made a bit more tricky because the form is
> tabular..?
>
>
> Thanks,
> Lap[/color]
  #7  
Old November 12th, 2005, 03:45 PM
Trevor Best
Guest
 
Posts: n/a
Default Re: 'odd' colour request

On 21 Nov 2003 12:36:03 GMT in comp.databases.ms-access, Lyle
Fairfield <MissingAddress@Invalid.Com> wrote:
[color=blue]
>Have you tried this with a continous form - datasheet form?
>
>Private Sub Form_Click()
> Me.DatasheetBackColor = vbRed Xor Me.DatasheetBackColor
>End Sub
>
>"Clicking" the form can be accomplished by clicking a record selector.[/color]

Interesting, almost a sort of highlighted colour for the current
record, sometimes you have to click twice though and clicking on
another record turns the previous one back to normal or they all turn
blue or all turn white. Not sure if any of that is supposed to happen
or not.

--
A)bort, R)etry, I)nfluence with large hammer.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

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 220,989 network members.