Lebans Holdings 1999 Ltd.

 Home ] Up ] Feedback ] Contents ] Search ] What's New ] Files & Tips ] 

ConditionalFormatting
Home
Up
Select A Row
Magnify
LimitCharsMemo
RotateText
ImageClass
AutoSize TextBox
ZoomInOut
PaintProgram
FormatByCriteria
CmdButton
SetGetSB
Transparent
AnimatedGifPlayer
LoadJpegGif
ImageControlToClipBoard
CanGrow
LimitTextInput
AutoSizeFont
AnimateForm
AutoUpDown
MonthCalendar
AutoColumnWidth
RichText
SelectAlpha
FormDimensions
LoadSaveJpeg
TabColors
ToolTip
TextWidth-Height
MouseWheelOnOff
AlternateColorDetailSection
ConFormsCurControl
ConditionalFormatting
AutoSizeOLE
ChangeMDIBackGround
RecordNavigationButtons
HTMLEditor
CopyGetRTFfromClipboard
OpenForm
GradientFill

RETIRED! September 2009

I have officially retired from all things Access. Please do not send Email requesting support as I will not respond.

 

Keep all of your questions to the Newsgroups where everyone will benefit!

 

 

A2K or Higher Only!

New Feb 08,2002. Added support for Datasheet view and SubForms.

A2KConditionalFormatting.zip is a sample MDB demonstrating how to programmatically setup Conditional Formatting to simulate:

1) Highlighting of the Current Row for a Form in Continuous or Datasheet View

2) Highlighting of Alternate Rows for a Form in Continuous or Datasheet View

Version 2.7

Added sample demonstrating how to achieve a background Hover/Highlighting of rows for a form in Continuous view.

Version 2.3

Added sample demonstrating how to achieve pseudo enable/disable of an unbound control on a form in Continuous View.

Version 1.9

Added sample form to show how to apply conditional formatting to based on a Boolean(Yes/No) field.

Verrsion 1.8

Starting to cleanup code and add comments!

Version 1.4

First release

 

#Release Notes:

 Private Sub Form_Load()
Dim objFrc As FormatCondition

' Remove any existing format conditions.
Me.txtBackGround.FormatConditions.Delete

' Create a format object and add it to the FormatConditions collection.
' We have to pass to pass a value to the function otherwise
' Access will only execute the function once.
' Also due to a bug we must programmatically setup the
' Conditional Formatting here. Otherwise if you were to setup
' CF via the GUI the state of the Disabled property
' is not respected. This will allow our Background TextBox control
' to receive the focus and be activated - something we don't want!!


Set objFrc = Me.txtBackGround.FormatConditions.Add(acExpression, _
, "Hover([txtFormat],[RowNumber])")

' Setup our props
With Me.txtBackGround.FormatConditions(0)
.BackColor = vbRed
.Enabled = False
End With
Set objFrc = Nothing
End Sub

 

 

Author: Van T. Dinh

I am helping someone to use the above to highlight the CurrentRecord of a Subform in ContinuousFormView in his database. I eventually found out that he couldn't get your Class Module "clsConditionalFormattingDataSheetView" to work due to the explicit references to the actual Control "txtcustomerid" rather than the "mKeyControl" TextBox object in the Class Module.

Here is the statement from your Class Module:

....

If mShowHighlightingAlternate = False Then

Set objFrc = ctl.FormatConditions.Add(acExpression, _

, "fCurrentRow([txtcustomerid])")

Else

Set objFrc = ctl.FormatConditions.Add(acExpression, _

, "fAlternateRow([txtcustomerid])")

End If

...

I have changed the above statements to the following:

...

If mShowHighlightingAlternate = False Then

Set objFrc = ctl.FormatConditions.ADD(acExpression, _

, "fCurrentRow([" & mKeyControl.Name & "])")

Else

Set objFrc = ctl.FormatConditions.ADD(acExpression, _

, "fAlternateRow([" & mKeyControl.Name & "])")

End If

...

so that it works in general which seems to work fine in the mdb I am working on.

Cheers

Van T. Dinh

 
 

May 23, 2004 Product Update
 
 
Rich Text ActiveX control. Version 1.8

Click Here!

 

Mar 15, 2005 Product Update
 
MouseHook  Replaces the MouseWheel DLL subclassing solution. Turns On/Off the MouseWheel with one line of code. No DLL registration required. Now supports Logitech mice!

Click Here! 

 

 

 
Back ] Home ] Up ] Next ] 
Stephen Lebans Copyright 2009

Last Modified : 09/11/09 12:03 AM