conditional formatting - more format choices?

K

Ken Cobler

I would like to know if there are more choices for conditionally formatting a
text box, besides font style/background color. I am making a report to be
used for field input, and whereever a text box is blank, ideally I would like
to have the text box underlined, to bring it to the user's attention.

I have used the format for background color, but to have the box bordered or
underlined would be best.

Thanks.
 
D

Duane Hookom

If you know a little code, you have lots of options. For instance add a line
control at the bottom of your text box and code in the On Format event of
the detail section:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.YourLine.Visible = IsNull(Me.txtYourField)
End Sub
 
K

Ken Cobler

I'm new to coding, and it took me a few minutes to find the On Format event -
- it occurred to me that this event is found on the overall report's
Properties, not on the Line's properties. Now the line appears just as it
should. Thank you.

Here's a followup question: I will be adding lines to most all textbox
fields that are blank. What is the best way to do this for multiple lines?
Can I nest them all in the same routine, such as :

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.Line101.Visible = IsNull(Me.txt101)
Me.Line102.Visible = IsNull(Me.txt102)
Me.Line103.Visible = IsNull(Me.txt103), etc.....
End Sub

Obviously I am learning from the ground floor.

Thank you for your help.
 
E

Eric_G

I am attempting to do something similar -- to only display the border of a
particular text box field when there is a value other than "Y". If the value
is "Y", then suppress the border (i.e. make it transparent).

Any suggestions?
 

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

Top