Using single quote

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have tried to solve my problem through existing questions that have been
posted and answered to no avail. I have a field that is a standard number
with 3 decimal places. The number is a unit of measurement and I want to
format the field to add a single quote at the end of the number. I have
tried 2 single quotes and the Chr function. I need some help.

The field name is roll_length.

If I enter 221.365, I want the result to be: 221.365"

Thanks for any help.
 
The standard terminology in the world of Access/VBA is to refer to an
apostrophe as a single quote, and a quotation mark as a double quote.

In the control source of an unbound control you could set the control source
to:
=Format([roll_length],"0.000") & """"
Expanded for clarity, that is:
=Format([roll_length],"0.000") & " " " "

Similarly, you could create a query field. In query design view, at the top
of an empty column, something like:
NewField: Format([roll_length],"0.000") & """"

You can use Chr(34) in place of """"
 
I have tried to solve my problem through existing questions that have been
posted and answered to no avail. I have a field that is a standard number
with 3 decimal places. The number is a unit of measurement and I want to
format the field to add a single quote at the end of the number. I have
tried 2 single quotes and the Chr function. I need some help.

The field name is roll_length.

If I enter 221.365, I want the result to be: 221.365"

Thanks for any help.

Try:

Format([fieldname], "#.###\""")

The backslash makes the next character a literal; but to include a
doublequote in a string delimited by doubleqluotes, you need a double
doublequote. (how's that for doubletalk!)

John W. Vinson [MVP]
 
Does this only apply to an unbound control? What if I already have it bound
to a field in an existing table?

BruceM said:
The standard terminology in the world of Access/VBA is to refer to an
apostrophe as a single quote, and a quotation mark as a double quote.

In the control source of an unbound control you could set the control source
to:
=Format([roll_length],"0.000") & """"
Expanded for clarity, that is:
=Format([roll_length],"0.000") & " " " "

Similarly, you could create a query field. In query design view, at the top
of an empty column, something like:
NewField: Format([roll_length],"0.000") & """"

You can use Chr(34) in place of """"

spcruise said:
I have tried to solve my problem through existing questions that have been
posted and answered to no avail. I have a field that is a standard number
with 3 decimal places. The number is a unit of measurement and I want to
format the field to add a single quote at the end of the number. I have
tried 2 single quotes and the Chr function. I need some help.

The field name is roll_length.

If I enter 221.365, I want the result to be: 221.365"

Thanks for any help.
 
Borrowing from John Vinson's response elsewhere in this thread, set the text
box format to 0.000\", and keep it bound to the number field. It will
probably help with data entry if you remove 0 as the default value for the
number field (tble design view). Note that using #.### as the format will
allow up to three decimal places, while using 0.000 will add zeros so that
there are always three decimal places:
1.1 vs. 1.100
3. vs. 3.000
5.52 vs. 5.520

spcruise said:
Does this only apply to an unbound control? What if I already have it
bound
to a field in an existing table?

BruceM said:
The standard terminology in the world of Access/VBA is to refer to an
apostrophe as a single quote, and a quotation mark as a double quote.

In the control source of an unbound control you could set the control
source
to:
=Format([roll_length],"0.000") & """"
Expanded for clarity, that is:
=Format([roll_length],"0.000") & " " " "

Similarly, you could create a query field. In query design view, at the
top
of an empty column, something like:
NewField: Format([roll_length],"0.000") & """"

You can use Chr(34) in place of """"

spcruise said:
I have tried to solve my problem through existing questions that have
been
posted and answered to no avail. I have a field that is a standard
number
with 3 decimal places. The number is a unit of measurement and I want
to
format the field to add a single quote at the end of the number. I
have
tried 2 single quotes and the Chr function. I need some help.

The field name is roll_length.

If I enter 221.365, I want the result to be: 221.365"

Thanks for any help.
 
Back
Top