Quote marks in reports

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?
 
M

Marshall Barton

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 '
 

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