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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

more than 3 conditional formats

Status
Not open for further replies.

welshone

Programmer
Jul 30, 2001
414
GB
hello all,
is it possible to have more than 3 conditional formats on a continuous form ?


thanks for any info.
W
 
Conditional formatting is fundimentally limited to 3 options per control ( Control; not Form, continuous or otherwise )


If you need more than three options then you need to do it in code - just like we always used to do before CF.




G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
thanks for the response,
however, I don't know how to do this using code.
do you have any code samples or web links to tuitions ?

cheers.
 
In the Form's ON_Current event you put some code that looks at the values you are interested in a assigns an object's colour/font etc appropriately

Eg

If you have a text box control with a number in it you might do something like

Code:
Private Sub Form_Current()
txtValue.FontSize = 10
lblSpecialFlag.Visible=False
Select Case txtValue
Case < 0
    txtValue.BackColor = 123456
Case = 0
    txtValue.BackColor = 3456789
Case < 10
    txtValue.BackColor = 4354437
Case Else
    txtValue.BackColor = 4354437
    txtValue.FontSize = 12
    lblSpecialFlag.visible = True
End Select


'ope-that-'elps.
End Sub


G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Hi!

A search on these fora should give something (and is always encouraged). Here are two threads:
thread702-647405, thread702-661512

Else, I ususally say that conditional format has four formats. Three based on meeting different conditions, and the fourth when no condition is met.

Roy-Vidar
 
Hello,

The result of using the 'select case' in the 'on current' event is that the entire continuous form gets the formatting of the selected record. This does not replace the effect of conditional formatting.

Any other suggestions?

Regards,

Bit
 
Oh - you didn't mention that you were using continuous forms.

No the Select case only works on single record view because it relies on running in response to the OnCurrent event - which is itself a single record event.




G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top