I've found that this occurs with conditional formatting when you don't take account of the existing format when making the changes. This occurs mostly with timer events checking state.
What you need to do is to only change the formats that need to be changed.
For Example:
Red text if a value is less than zero, otherwise black.
The procedure would look something like this:
(The dots at the left margin are an attempt to preserve the formatting)
. if txtFieldName < 0 then
. if txtFieldName.forecolor <> vbRed then
. txtFieldName.forecolor = vbRed
. endif
. else
. if txtFieldName.forecolor <> vbBlack then
. txtFieldName.forecolor=vbBlack
. end if
. end if
This prevents a colour change if the forecolor is not already the required colour.
It is a nuisance to code and if anybody knows a simpler way PLEASE share it!! 8o)
If you have multiple formatting to do you can turn of the repainting of the form using
me.painting=false 'before starting
'do your formatting
me.painting = true 'when finished
you may need to force painting using me.repaint.
You should also make sure that any error handler includes the line
me.painting = true
Otherwise you may not be able to see anything that happens on the form.
Hope this helps
John