-
When I have data in a Grid(dbGrid) and i try to remove the cell information to leave it empty it comes back to me and say, "Field.Age can't be zero-length string". Any idea on how I can leave this field empty if user doesn't enter anything in the cell. I've tried everything and can't figure this out.
B. Servello
-
Zero Length
Bo not think it is anything to do with dbGrid - more likely the field definiton of Age - Check the AllowZeroLength property of the field and ensure that it is set to True. If you need to set it in code it is a property of the Field in a TableDef.
Cheers,
Paul.
-
Didn't work
It didn't work.
Can you please show me in a few lines of code what to do and have you ever seen this.
Bruno
-
OK
Code:
Dim db as Database
Dim td as Tabledef
Dim fld as Field
Set db = CurrentDb
Set td = db.MyTable
Set fld = td!Age
fld.AllowZeroLength = True
Set fld = Nothing
etc.
Hope it helps,
Get back 2 u tomorrow.
Paul
-
didn't work
-
Got Answer
The reason why none of them were working is because you have to go to the Access file design mode ane say Yes to allow zero, not in the code.
B
-
ZeroLength
Certainly does work in code - easier in Design mode but I have some standard routines that examine table structures and will modify this property.
Do not know what you tried but the code does work in the way I posted it.
Cheers,
Paul.