473,395 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 11182
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 operator on a varchar field as follows .......
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 apparently the default when you create a new text...
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 filter out all the hyperlink fields that are empty. I...
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 application. Intermittently the remote application falls...
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 the page throuh IE 6 and not Netscape browsers. I...
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(), all the textboxes go blank, so I can add a new...
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 statement that will delete any value in a said field. For...
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 Null, the Nz function returns the number zero or a...
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 user deletes a pre-existing value (leaving a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.