looking for format trick

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

Hi,

I have a form which allows the user to pick and choose
fields. This form also have a command button which pulls
up a report. The report has a text box who's record
source is created based on what fields the user selected
on the form. The record source is built as follows:

field1 & "|" & field2 & "|" & field3..........

It's a little more complated than that, but I hope you get
the idea. The text box has a border of 2 points. My
problem is that the vertical bar character ("|") dosen't
seperate the fields like I want. Is there any way to
place a veritcal line between the fields so that each
field looks like it's in its own box? If the field were
all the same size I could use separate text boxes for
each, but every field can be a different size.

Thanks,
Phil
 
Hi Phil,

I hope I understand your problem correctly.

But if the problem is that when you add the "|" & the
fields do not line up, change the Font of the Text Box to
"Courier New"

This font has all characters as the same size unlike most
other fonts so for example

|aaa |
|XXX |

As you will see since this is Courier New they will line
up even though "a" is smaller than "X"

I hope this helps,
Jeff
 
Thanks Jeff,

No that's not the problem. I'm already using Courier New.
What I want is a character (line or whatever) that has a
wider width and higher height than the "|", so that the
separation of the fields are more noticable. Right now
the "|" has the same appearance as any other character in
the line.

Thanks again,
Phil
 
You might want to try something like the following that would draw the boxes
and print the text. Add the three text boxes to your detail section but make
them invisible.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim intTop As Integer
Dim lngLeft As Long
Dim lngRight As Long
Me.DrawWidth = 6
Me.FontName = "Courier New"
intTop = 400 '400/1440 inches from top of detail section
Me.CurrentX = 1440 '1 inch from left margin
lngLeft = 1440 '1 inch
Me.CurrentY = intTop
Me.Print Me.Field1
Me.Line (lngLeft, intTop)-(Me.CurrentX, Me.CurrentY), , B
Me.CurrentY = intTop
lngLeft = Me.CurrentX
Me.Print Me.Field2
Me.Line (lngLeft, intTop)-(Me.CurrentX, Me.CurrentY), , B
Me.CurrentY = intTop
lngLeft = Me.CurrentX
Me.Print Me.Field3
Me.Line (lngLeft, intTop)-(Me.CurrentX, Me.CurrentY), , B
End Sub
 
Back
Top