Quote marks in reports

  • Thread starter Thread starter Andy Williams
  • Start date Start date
A

Andy Williams

I have a report which needs to print dimensions (in
inches) from data in a table. I am using a text box with
the following format: #.###"''"

This gives me the desired result when there are digits to
the right of the decimal, but for plain integers it
includes the decimal point.

Any ideas?
 
Andy said:
I have a report which needs to print dimensions (in
inches) from data in a table. I am using a text box with
the following format: #.###"''"

This gives me the desired result when there are digits to
the right of the decimal, but for plain integers it
includes the decimal point.

The custom formatting codes do not allow for an optional
decimal point.

Make the text box (I'll call it txtInches) that's bound to
the inches field invisible and add another text box to
display the number the way you want (let's name this new
text box txtFormatted). Then, use code in the Format event
of the section containing these text boxes.

If Me.txtInches = Int(Me.txtInches) Then
Me.txtFormatted = Me.txtInches & """"
Else
Me.txtFormatted = Format(Me.txtInches, "#.###\"")
End If

Note that I'm using " for inches, not two '
 
Back
Top