473,889 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11232
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*********@ho tmail.comwrote in message
news:11******** **************@ o61g2000hsh.goo glegroups.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...@ho tmail.comwrote in message

news:11******** **************@ o61g2000hsh.goo glegroups.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*********@ho tmail.comwrote in message
news:11******** **************@ 57g2000hsv.goog legroups.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...@ho tmail.comwrote in message

news:11******** **************@ o61g2000hsh.goo glegroups.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
10286
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 .... WHERE dbo.tbl_pm_projects.SeniorManagerID LIKE '%' .... In actual fact the % is passed in by the application when the user
2
5329
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 field. Please correct me if I'm wrong about this. Somehow (I'm clueless about how), some of my user's records have ended up with zero length strings in some of these fields -- despite the restriction. The restriction is not important to the...
5
24644
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 open a recordset and browse through all the fields to check for the word file. I cannot filter out the empty fields. I have tried: If Len(.Fields("Link") <> 0 then and: If Not IsNull(.Fields("Link")) then
0
391
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 over with an error (see below for details). This seems to happen on different pages after an asp forms button is clicked, and brings down the whole application when it does happen. When it happens you cannot browse to any page within the...
1
9982
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 am not sure exactly what is throwing it off, especially in the form tag Has anybody seen this happening to them? It worked on IE briefly and then it started happening again. Any help would be greatly appreciated Here is the full source of the...
2
5912
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 record. If I leave a field totally blank, and then click the Update button (which uses the DataAdapter.Update() command, I get an error saying: "Field 'Orders.Email' cannot be a zero-length string"
6
1480
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 example: strSQL = "UPDATE rounds set Rd3 = '' where name = '" & var2 & "' and meeting = " & var1 & "" conn.execute (strSQL)
10
4602
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 zero-length string (always returns a zero-length string when used in a query expression)" **** How many records are there in FirstTable in which Product Is Null. SELECT COUNT(*) AS CountofNullProdcut
7
8085
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-length string I guess) and then clicks in the Insertion control. This results in Runtime error '2110' with the message that "can't move the focus to the control Calendar0" I think this is because I've made Insertion a required field - certainly the...
0
9962
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10791
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10889
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9609
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7150
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5829
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4647
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3256
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.