By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,124 Members | 2,208 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,124 IT Pros & Developers. It's quick & easy.

Field cannot be a zero length string

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.