Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zero length string

Status
Not open for further replies.

phayzer

Technical User
Aug 27, 2000
4
US
Hello,

I've created a form that people will fill out online. When the form is filled out, the information is inserted in an Access database.

When I test the form (using PWS), I fill in all questions in the form. However, I'm getting this error message:

[Microsoft][ODBC Microsoft Access Driver] Field 'client_information.genre' cannot be a zero length string.

In design view, "Allow zero length" and "Required" are both set at "No". I've tried setting the data type to "Text" and "Memo".

In a couple of cases when I was able to fill out the form and submit the information without any error message, some (but not all!) of the information did not get inserted into the database.

Any suggestions as to what the problem is?

Thanks!
 
You are mis-understanding what NO means in the "Allow zero length"
Look at it closely. It is saying do you want to allow a zero lenght string to be insterted in your field, you have NO. So that's why you are getting the Error. Change it to "yes" and the error will go away.
 
Just a note here for people viewing this - the "Memo" datatype cannot be Null... This caused me alot of aggravation. Although in a table the field may APPEAR Null, It is actually a zero-length string "". Hope I save someone a headache...
Chris
 
Hi Doug and Chris,

Thanks for your messages. I said "yes" to Allow Zero Length Strings but only certain information from the form is inserted into the database. Also, I don't really want to allow zero length strings - in other words, I want the user to fill out that part of the form. I have also set Required to yes as well, in some cases.

However, for some reason select data isn't being inserted into the database.

It does seem that I'm only having this problem when I've selected Memo. Chris, I apologize if I'm slow on the uptake, but what steps exactly did you take to resolve your problem? Eg what properties did you select?

Thanks.
 
I was just mentioning this little quirk of Access. Sometimes you may want to do something like cycle through a table and if the field is null then do something. i.e.

if isnull(rst!Description) then
msgbox "Null field"
end if

BUT - If Description field happens to be of type 'Memo' then you will NEVER get a Null even if the field appears blank. This is because the default for a Memo field is the empty string "", and a Memo field can never be Null.
Hope this clears things up a bit.
Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top