472,353 Members | 1,242 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Field cannot be a zero length string

I inherited a database. On one of the forms, a bunch of fields on the
form are to be updated with data from a combo box containing many
columns after one particular field is updated. I'm receiving an error
message "Field cannot be a zero length string." I do have some records
with null values for a few fields - no way around that. How can I
prevent the error message from occurring? Here's a sample of the
code...

Me![Union Code] = Me![Name].Column(9)
Me![Location] = Me![Name].Column(10)
Me![Address] = Me![Name].Column(11)

Aug 5 '07 #1
3 10848
a zero-length string and a Null value are two different things. AFAIK, in a
combobox control, a Null value in a field in the RowSource "becomes" a
zero-length string in the Column value. try something along the lines of

If Me![Name].Column(9) = "" Then
Me![Union Code] = Null
Else
Me![Union Code] = Me![Name].Column(9)
End If

hth
"Coll" <co*********@hotmail.comwrote in message
news:11**********************@o61g2000hsh.googlegr oups.com...
I inherited a database. On one of the forms, a bunch of fields on the
form are to be updated with data from a combo box containing many
columns after one particular field is updated. I'm receiving an error
message "Field cannot be a zero length string." I do have some records
with null values for a few fields - no way around that. How can I
prevent the error message from occurring? Here's a sample of the
code...

Me![Union Code] = Me![Name].Column(9)
Me![Location] = Me![Name].Column(10)
Me![Address] = Me![Name].Column(11)

Aug 5 '07 #2
On Aug 5, 12:03 am, "tina" <nos...@address.comwrote:
a zero-length string and a Null value are two different things. AFAIK, in a
combobox control, a Null value in a field in the RowSource "becomes" a
zero-length string in the Column value. try something along the lines of

If Me![Name].Column(9) = "" Then
Me![Union Code] = Null
Else
Me![Union Code] = Me![Name].Column(9)
End If

hth

"Coll" <col_mcma...@hotmail.comwrote in message

news:11**********************@o61g2000hsh.googlegr oups.com...
I inherited a database. On one of the forms, a bunch of fields on the
form are to be updated with data from a combo box containing many
columns after one particular field is updated. I'm receiving an error
message "Field cannot be a zero length string." I do have some records
with null values for a few fields - no way around that. How can I
prevent the error message from occurring? Here's a sample of the
code...
Me![Union Code] = Me![Name].Column(9)
Me![Location] = Me![Name].Column(10)
Me![Address] = Me![Name].Column(11)- Hide quoted text -

- Show quoted text -
HI - that worked for one of the fields, but on another field, I'm now
getting this error message "object does not support this property or
method"
Any ideas?

Aug 8 '07 #3
not really. you might check that you haven't referenced a column that
doesn't exist.
"Coll" <co*********@hotmail.comwrote in message
news:11**********************@57g2000hsv.googlegro ups.com...
On Aug 5, 12:03 am, "tina" <nos...@address.comwrote:
a zero-length string and a Null value are two different things. AFAIK,
in a
combobox control, a Null value in a field in the RowSource "becomes" a
zero-length string in the Column value. try something along the lines of

If Me![Name].Column(9) = "" Then
Me![Union Code] = Null
Else
Me![Union Code] = Me![Name].Column(9)
End If

hth

"Coll" <col_mcma...@hotmail.comwrote in message

news:11**********************@o61g2000hsh.googlegr oups.com...
I inherited a database. On one of the forms, a bunch of fields on the
form are to be updated with data from a combo box containing many
columns after one particular field is updated. I'm receiving an error
message "Field cannot be a zero length string." I do have some records
with null values for a few fields - no way around that. How can I
prevent the error message from occurring? Here's a sample of the
code...
Me![Union Code] = Me![Name].Column(9)
Me![Location] = Me![Name].Column(10)
Me![Address] = Me![Name].Column(11)- Hide quoted text -
- Show quoted text -

HI - that worked for one of the fields, but on another field, I'm now
getting this error message "object does not support this property or
method"
Any ideas?

Aug 8 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Niall Porter | last post by:
Right this has to be a Micro$oft mess-up surely...? I'm running SQL 2k standard with SP3. I have a table which I'm trying to query using a LIKE...
2
by: LaurenW | last post by:
Hi folks, I just discovered that I have a table with a bunch of text fields that ALL have the "Allow Zero Length" property set to "No", which is...
5
by: Krechting | last post by:
Hi ALl, I have a code that checks if the documents in a hyperlink field are still where they should be. I use fileexist(). First I want to...
0
by: John Mason | last post by:
Hi, I have developed an asp.net application that uses forms authentication. I have a local install and a remotely hosted install of the...
1
by: Hozi | last post by:
I am getting the below error when asp.net tries to parse the .aspx file. The funny part is that the error only seems to be happening when viewing...
2
by: johnb41 | last post by:
I have a simple form that has a bunch of textboxes that show data from a dataset table. When I "Add" a record with BindingManagerBase.AddNew(),...
6
by: Jeff | last post by:
Ok, I am using asp that has SQL in it. I couldn't find a proper SQL NG, so I will post it in here and see if I can obtain help. I need a...
10
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/html/acfctNZ_HV05186465.asp "If the value of the variant argument is...
7
by: kiwipedia | last post by:
Hi all I have a combo-box control which I've set as a required field. It's a date and uses a calendar as coded below. All works fine unless the...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.