conditonal formating problem

K

KillerWhale65

hi,

i am using this code to display the default value in a field only when a
checkbox is checked. the checkbox is called foto, and the field is called
foto2. On default, the forecolor is the same as the backcolor so the default
value will not display. This code should change the forecolor to black for
every record where the checkbox is marked, but it doesnt. I got it from
another db where it does work. What am i doing wrong?

Code:
----------------------------------------------------------------------------
----

Private Sub Form_Load()Me.foto2.BackStyle = 0 ' transparentDim objFrc As
FormatCondition' Remove any existing format
conditions.Me.foto2.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.
Set objFrc = Me.foto2.FormatConditions.Add(acExpression, _ ,
"ShowControl([foto],[foto2])") ' Setup our props With objFrc
..ForeColor = vbBlack .Enabled = True End WithSet objFrc = NothingEnd
Sub
 

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

Similar Threads


Top