Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conditional background color ?

Status
Not open for further replies.
Aug 2, 2000
325
0
0
US
I have a subform which creates new records for verious phone numbers. Each phone number has a default value in a second field (which is based off of a DefaultValues table. You can change the value throughout the day, the subform refreshes and displays the new values for each phone number.

what I need to do is conditionaly check on the subform to see if the value of the second field for all of the phone numbers matches the defaultvalue second field. If it doesn't then I need to change the background color to blue.

Any help would help a heap.
Thanks,
Dave
 
Check out the following link to the Access Web (an excellent site)



there are a couple of articles here that address your question of conditional formatting of continuous forms.

This can be done with no actual coding.

I believe that all of the techniques used require that a field be present in your data source for the form (subform) which indicates the status which indicates color selection. That is, the record source for your subform needs to be a query. This query needs to have a True/False field which indicates if the second field matches its default value. Something like

MatchesDefault: [SecondField] = [SecondFieldDefaultValue]


This will cause MatchesDefault to contain the status of the comparison. You then have a text box on your form bound to the MatchesDefault field. The properties of this text box are something like:

Format = ;"ggggggggggggggggggggggggggggggggggggggggg"
that is a blank followed by a semi-colon followed by a long string of the lowercase G. You may need to add more g's to the string to get the effect you are looking for.

Font Name = Webdings
Fore Color = whatever color you want to use
Back Style = Transparent

Height & Width:
if you want to highlight the whole line it should be equal to the height and width of detail section

if you only want to highlight just the phone number text box it should be equal to the height & width of your phone number text box.

Top & Left:
if you want to highlight the whole line they should both be equal to zero

if you only want to highlight just the phone number text box they should be equal to the Top & Left of your phone number text box.


What happens is that the Format for the text box displays the blank character if MatchesDefaule is true, and the Webding equivalent of "gggggggg...gggg" if false.

Play with the "Send To Back", "Bring To Front", and the background transparency of the text boxes involved (including the one bound to MatchesDefault) to achieve the effect you are looking for.
 
I'm doing something wrong. How should I be binding the Text Box with all the gggggg's in it? And what are the ggg's for ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top