Click to See Complete Forum and Search --> : Any dbGrid Experts, Need help !
bservello
Oct 30th, 2000, 09:55 AM
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
paulw
Oct 30th, 2000, 10:00 AM
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.
bservello
Oct 30th, 2000, 10:27 AM
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
paulw
Oct 30th, 2000, 10:33 AM
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
bservello
Oct 30th, 2000, 11:06 AM
It doesn't work.
B
bservello
Oct 30th, 2000, 11:34 AM
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
paulw
Oct 31st, 2000, 03:58 AM
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.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.