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!

Field 'tblXXX.PO#' can't be a zero-length string.

Status
Not open for further replies.

cppiston

Programmer
Feb 27, 2002
23
US
I have an Access front end with linked SQL tables. when I try to run the action, I get this error: Field 'tbl_XXX_.PO# ' can't be a zero-length string? What should I do? On the table itself where it gets the data from is blank, no value?
 
The basic problem is that you're trying to put a '' (i.e. a string with nothing in it), into a field on SQL Server that won't allow it. You can either change the value to a null (assuming the field will take it). In SQL you would do it thus:
NULLIF(fieldvalue,'')
which returns null if the fieldvalue='' or else the fieldvalue.
Otherwise you could try and default it to a single space thus:
isnull(Nullif(fieldvalue,''),' ')
Note the space between the second set of quotes. This basically says: If it's '', set it to null, then if it's null set it to ' '.
Let me know if this don't help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top