Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 3rd, 2005, 11:59 AM
USCitizen USCitizen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 19 USCitizen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 21 m 37 sec
Reputation Power: 0
Combo Box Woes With Conditional Formatting

i am using a2k.

to make things simple, let's say i have a combobox (cbx) on my form as a bound control to an underlying table. the control source and name of the control is 'Cycle'. it's defined as a 'byte' number on the table's design and gets filled in by the user from a l/u table having the values 0,1,2,3,4,....28,99 (there are no numbers btwn 28 and 99 on purpose).

what i'm trying to do is cause this field to have a red background when the user is creating a new record to draw user's attention to fact it needs to be entered (it is the second member of a composite PK comprising "Patient Number" and "Cycle"). so, i want the background to display in red until the user's entered a value from the l/u table.

what i've done is decreed the field's default color is red and in the conditional formatting pull down thing used an "Expression is" option for Condition 1 that says "[Cycle] Is Not Null" (w/o the quotation marks).

it's weird, but the field color is never red for this cbx control when the field is open i add record mode although it is red in the design mode. the other thing that's weird is that if, instead of using this "Expression is" option, i replace that with "Field is less than" 0, then no the field does turn red when user goes to add new record and it never stops being red (no matter what value from the cbox is selected). to round things out a bit.....however there is a neighboring control alongside it called "Day Number" which has the said configuration which complies with my design?!?

any clues?

Reply With Quote
  #2  
Old February 3rd, 2005, 05:34 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
I think what I would do is use the forms On Current property to handle the colors. Besides changing the back color, you might want to change the forecolor so the text can be seen. By default the black text on red background is hard to read. So place this code in the On Current Event of the form:

If IsNull(Combobox) Then
Combobox.BackColor = 255
Combobox.ForeColor = 16777215
Else
Combobox.BackColor = 16777215
Combobox.ForeColor = 0
End If

Then in the AfterUpdate of the combo box use the Me.ReQuery method. Change the syntax to the combo box name you use.

lwells

Reply With Quote
  #3  
Old February 8th, 2005, 10:32 AM
USCitizen USCitizen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 19 USCitizen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 21 m 37 sec
Reputation Power: 0
thanks



Quote:
Originally Posted by lwells
I think what I would do is use the forms On Current property to handle the colors. Besides changing the back color, you might want to change the forecolor so the text can be seen. By default the black text on red background is hard to read. So place this code in the On Current Event of the form:

If IsNull(Combobox) Then
Combobox.BackColor = 255
Combobox.ForeColor = 16777215
Else
Combobox.BackColor = 16777215
Combobox.ForeColor = 0
End If

Then in the AfterUpdate of the combo box use the Me.ReQuery method. Change the syntax to the combo box name you use.

lwells

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Combo Box Woes With Conditional Formatting


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT