Independently formatting continuous form fields

P

Penny

Hi All,



I have a continuous form which shows a list of meetings that a consultant
has booked for certain timeslots. It works well to do this much. However, I
would also like each MeetingSubject field to have its backcolor display
according to the meeting type(or remain white if no meeting type is
selected). The forms record source is a query which draws from two tables to
retrieve the MeetingSubject, MeetingType and MeetingTypeColor. I have
another form which allows the user to add/edit/delete meeting types AND
change their colors(using the comdlg32.dll dialog so the colors are held in
tblMeetingTypes as Long Integers).



If the continuous form is to display many records of varying meeting type
colors(or none at all), how can I code it to do so? The 'Conditional
Formating' wizard isn't suitable as the MeetingTypeColor values are held in
a table and change at the users discretion.



Any ideas?



Regards,



Penny.
 
L

Larry Linson

Penny said:
If the continuous form is to display many
records of varying meeting type colors (or
none at all), how can I code it to do so? The
'Conditional Formating' wizard isn't suitable
as the MeetingTypeColor values are held in
a table and change at the users discretion.

You could Google for posts on changing the Background Color of Controls in
Continuous Forms View from the days before Conditional Formatting, but I
caution that some methods were downright ugly, and all were more work than I
ever thought was worth my time and my clients' expense.

Conditional Formatting was introduced to solve this problem.

The problem is that there is only one definition of the Controls, and the
instance of that which is referenced by code is the active or selected
Record, and the others are just repetition of that, showing data from
different Records. If you set the Backcolor property of a particular
Control for the active/selected Record, that sets it for all repetitions,
too.

Larry Linson
Microsoft Access MVP
 
P

Penny

Hi Larry,
The problem is that there is only one definition of the Controls, and the
instance of that which is referenced by code is the active or selected
Record, and the others are just repetition of that, showing data from
different Records.

Yes, you understand my probem exactly. The formatting repeats for each
record. Bummer to hear an expert confirm my fears :(

Do the 'ugly' methods you mentioned have anything to do with the
FormatCondition objects? I've read as much as I can about them too and it
seems they wont be any help.

I really appreciate your help Larry. Cheers.

Regards,

Penny.
 
D

Dirk Goldgar

Penny said:
Do the 'ugly' methods you mentioned have anything to do with the
FormatCondition objects? I've read as much as I can about them too
and it seems they wont be any help.

See what Stephen Lebans has done with programming FormatConditions at
www.lebans.com .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top