Field cannot be a zero-length string.

  • Thread starter Thread starter jhunter
  • Start date Start date
J

jhunter

=====
ISSUE
=====
I get this message *****SOMETIMES*****...

Field 'Table.Field1' cannot be a zero-length string.


=======================
WHEN I GET THIS MESSAGE
=======================
I have entered something in Field1 in the **PREVIOUS** record of a
continuous form (and ONLY when I try to go from the CURRENT **RECORD**
to a another record).


=============================
WHEN I do no GET THIS MESSAGE
=============================
If I've never entered anything in Field1. I can add as many records as
I want and never have a problem.


=====
NOTES
=====
1)Field1 is NOT set to required in the Table or Form properties.

2)I do use an AFTER UPDATE event for Field1 that does the following...

Me!Field1.DefaultValue = "'" & Me!Field1& "'"


3)There are no other events.


==========
BACKGROUND
==========
O/S = Win2k Pro
Patches Installed

Software = Access 2000
Patches Installed


=========
Thanks!!!
THE END
=========
 
It appears that the field, while Required is set to No, also has Allow Zero
Length set to No. Your DefaultValue statement is placing '' in as the
default value if the current value is Null. ("'" & Null & "'" will yield
''), thus you are getting a zero length string. Try removing the quotes and
the &'s.

Me!Field1.DefaultValue = Me!Field1
 
Back
Top