Talk About Network

Google





Software > Access Forms > Re: AfterUpdate...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 8 Topic 44670 of 46786
Post > Topic >>

Re: AfterUpdate Code

by "BruceM" <bamoob@[EMAIL PROTECTED] > Aug 8, 2008 at 01:59 PM

You could use the combo box Enter event (or maybe the Click event) to set 
the forecolor.  For instance:
Me.Combo56.ForeColor = vbWhite

If the forecolor depends on the current backcolor you would need to test
for 
that first, and choose a forecolor accordingly.

In the After Update event for Combo56, after the code to select the 
backcolor:

Me.Combo56.ForeColor = Me.Combo56.BackColor


"Joe" <Joe@[EMAIL PROTECTED]
> wrote in message 
news:DE24509E-8C01-436D-A87B-4A826961C6F7@[EMAIL PROTECTED]
> Thanks BrueM,
>
> Without following what I am doing, you've managed to hit the nail on the
> head. I have  tried setting the forecolor to match the backcolor -
exactly
> what I want. However, in this instance, the text is not visible when you
> click into the comb box making it difficult to know what color to
select. 
> I
> want the text to be visible when I click into the combo box but
invisible
> when a color is selected.
>
> Any ideas?
>
> Thanks.
>
> "BruceM" wrote:
>
>> I can't say I follow what you're doing, but maybe you could set the
>> forecolor to match the backcolor.  However, I expect you would still
see 
>> the
>> text when you click into the combo box.
>>
>> You mention the After Update event.  Is that for the combo box?  If so,

>> are
>> you selecting a color name from the combo box for the express purpose
of
>> changing the combo box backcolor?  If so, what is supposed to happen
when
>> you go to another record?
>>
>> BTW, Value is the default property for a combo box, text box, etc., so 
>> you
>> don't need to specify it.  Also, If IsNull is enough of a test; you
don't
>> need to check whether it's true:
>>
>> Me.Combo56.BackColor = IIf(IsNull(Me.Combo56), 15066597,
>> Switch(Me.Combo56 = "Green", 65280,
>> Me.Combo56 = "Yellow", 65535,
>> Me.Combo56 = "Red", 255,
>> Me.Combo56 = "Blue", 16737843,
>> Me.Combo56 = "Orange", 5220351))
>>
>> There's no harm to doing it the way you did, but it is easier to read
and
>> evaluate if it is pared down to the essentials.
>>
>> "Joe" <Joe@[EMAIL PROTECTED]
> wrote in message
>> news:850B3184-AB35-4A86-A3D1-2547A03CA70B@[EMAIL PROTECTED]
>> > Sorry, Doug. I am trying to get the background color to change when
>> > selected
>> > from the drop down without the name of the color showing like the 
>> > result
>> > achieved when conditional formatting is used. This purely cosmetic
and 
>> > I
>> > can
>> > live with what I am getting now if my question/query does not make 
>> > sense.
>> >
>> >
>> > "Douglas J. Steele" wrote:
>> >
>> >> I'm not sure I understand what you mean by "have a black text that 
>> >> shows
>> >> trough the color background". The code changes the back colour only,

>> >> not
>> >> the
>> >> text colour.
>> >>
>> >> -- 
>> >> Doug Steele, Microsoft Access MVP
>> >> http://I.Am/DougSteele
>> >> (no e-mails, please!)
>> >>
>> >>
>> >> "Joe" <Joe@[EMAIL PROTECTED]
> wrote in message
>> >> news:76E3E818-5DBA-46F9-81B9-EDEB205B7750@[EMAIL PROTECTED]
>> >> > This is message is being posted for code evaluation/correction to
a
>> >> > problem
>> >> > for which a partial solution was provided by "Klatuu". Any insight

>> >> > from
>> >> > the
>> >> > "MVPs" or anyone with a solution will be greatly appreciated. I am

>> >> > not
>> >> > a
>> >> > code
>> >> > expert so a simple suggestion/solution specific to the solution
will 
>> >> > be
>> >> > most
>> >> > useful.
>> >> >
>> >> > The code below changes the background color of a drop down menu 
>> >> > choices
>> >> > when
>> >> > placed in the After Update code section. However, the last two 
>> >> > colors,
>> >> > "Blue"
>> >> > and Orange" have a black text that shows trough the color 
>> >> > background.
>> >> > Why?
>> >> >
>> >> >
>> >> > Me.Combo56.BackColor = IIf(IsNull(Me.Combo56.Value) = True, 
>> >> > 15066597,
>> >> > Switch(Me.Combo56.Value = "Green", 65280, Me.Combo56.Value = 
>> >> > "Yellow",
>> >> > 65535,
>> >> > Me.Combo56.Value = "Red", 255, Me.Combo56.Value = "Blue",
16737843,
>> >> > Me.Combo56.Value = "Orange", 5220351))
>> >> >
>> >> >
>> >> >
>> >>
>> >>
>> >>
>>
>>
 




 8 Posts in Topic:
AfterUpdate Code
=?Utf-8?B?Sm9l?= <Joe@  2008-08-08 06:51:02 
Re: AfterUpdate Code
"Douglas J. Steele&q  2008-08-08 11:46:48 
Re: AfterUpdate Code
=?Utf-8?B?Sm9l?= <Joe@  2008-08-08 09:13:00 
Re: AfterUpdate Code
"BruceM" <ba  2008-08-08 12:50:26 
Re: AfterUpdate Code
=?Utf-8?B?Sm9l?= <Joe@  2008-08-08 10:30:00 
Re: AfterUpdate Code
"BruceM" <ba  2008-08-08 13:59:34 
Re: AfterUpdate Code
"Linq Adams via Acce  2008-08-08 18:14:45 
Re: AfterUpdate Code
=?Utf-8?B?Sm9l?= <Joe@  2008-08-08 11:58:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Fri Jan 9 17:01:26 PST 2009.