conditionel format aan continous form

  • Thread starter Thread starter el_bennito
  • Start date Start date
E

el_bennito

I have a continous form , on witch I need to apply 12 conditions.
Access only has standard 3 conditions build in to. so I can't use that
function .I now use the following code

Private Sub cboKlasVakID_AfterUpdate()
Select Case cboKlasVakID.Value
Case Is = 29
cboKlasVakID.BackColor = vbRed
Case Is = 30
cboKlasVakID.BackColor = vbRed
......

End Sub

problem is that whole form gets the same color.
any one got a solution?

benny
 
The nearest you can get to this would be to create a separate Colours table
with column ColourID and another column containing twelve bitmaps of each of
the colours. The values in the ColourID column should match the 12 possible
values of the KlasVakID column in the form's underlying table. Base the form
on a query which joins the Colours table to the existing table and show the
colour in a text box control on the form. You can position this as a patch
at one end of the row or behind and around other control(s) to create a
background. Experiment to find what suits you best.
 
Do you need to simply evaluate 12 individual conditions or do you need to
apply 12 different formats?

If you simply need to evaluate 12 conditions then you can call a custom
function and have it evaluate as many conditions as you want. If the
function returns TRUE then the format you have setup is applied, if the
function returns FALSE then no CF is applied.

For sample code see:
http://www.lebans.com/conditionalformatting.htm
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

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

Back
Top