double quotes characters not accepted in AllowZeroLength field

R

Ray C

I have a text field in a table that is a required field. This field must
accept a string made up of two double quotes. In other words, the double
quotes must be saved in the field. But when I attempt to save the record,
Access either erases the value or gives me an error message.

When I set the AllowZeroLength property to Yes the double quotes disappear
when I enter them in the field. When I set it to No, the double quotes gives
me an error message.

Help.
 
D

Dirk Goldgar

Ray C said:
I have a text field in a table that is a required field. This field must
accept a string made up of two double quotes. In other words, the double
quotes must be saved in the field. But when I attempt to save the record,
Access either erases the value or gives me an error message.

When I set the AllowZeroLength property to Yes the double quotes disappear
when I enter them in the field. When I set it to No, the double quotes
gives
me an error message.


This is going to be very hard to work around, as the Access user interface
is designed to interpret an entry of "" as a zero-length string. Do you
really have to save two double-quotes in the field? So far, the only way
I've been able to make this happen is to enter something else -- e.g., two
single-quotes ('') -- and then use an update query to transform them into
double-quotes (""):

UPDATE Table1 SET Table1.[TextField] = '""'
WHERE Table1.TextField="''"

I don't suppose you could just use two single-quotes instead? Or store a
zero-length string, and translate that into a pair of double-quotes for
reporting?
 
R

Ray C

Actually I do have a work-around at the moment that does exactly what you
explained. I was just wondering if there was an easier way that I was missing.

Thanks !!

Dirk Goldgar said:
Ray C said:
I have a text field in a table that is a required field. This field must
accept a string made up of two double quotes. In other words, the double
quotes must be saved in the field. But when I attempt to save the record,
Access either erases the value or gives me an error message.

When I set the AllowZeroLength property to Yes the double quotes disappear
when I enter them in the field. When I set it to No, the double quotes
gives
me an error message.


This is going to be very hard to work around, as the Access user interface
is designed to interpret an entry of "" as a zero-length string. Do you
really have to save two double-quotes in the field? So far, the only way
I've been able to make this happen is to enter something else -- e.g., two
single-quotes ('') -- and then use an update query to transform them into
double-quotes (""):

UPDATE Table1 SET Table1.[TextField] = '""'
WHERE Table1.TextField="''"

I don't suppose you could just use two single-quotes instead? Or store a
zero-length string, and translate that into a pair of double-quotes for
reporting?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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