By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,215 Members | 1,293 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,215 IT Pros & Developers. It's quick & easy.

Event procedure using iif for line breaks.

P: n/a
I am updating a large report that is queried from a table which I
recently changed. The table now contains line breaks for long company
names. The problem with this is that in my report I have a colored box
which changes dimensions according to how many lines of text there
are. The current code in VB is:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Dim intLines As Integer

Me.FillStyle = 0
Me.DrawWidth = 8
Me.FillColor = 16777164

If Len(txtAddressLine1 & "") <> 0 Then intLines = intLines + 1
If Len(txtAddressLine2 & "") <> 0 Then intLines = intLines + 1
If Len(txtEmailAdd & "") <> 0 Then intLines = intLines + 1
If Len(txtWebpage & "") <> 0 Then intLines = intLines + 1

Select Case intLines
Case 0
Me.Line (1, 1)-(9606, 1530), 0, B
Case 1
Me.Line (1, 1)-(9606, 1890), 0, B
Case 2
Me.Line (1, 1)-(9606, 2250), 0, B
Case Else
Me.Line (1, 1)-(9606, 2610), 0, B
End Select

End Sub

I'm not that experienced with VB, but there should be some way to do
this. The name field that I would be using is txtClinicName.

Thanks!
Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.