|
-
Oct 30th, 2000, 10:55 AM
#1
Thread Starter
Junior Member
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
-
Oct 30th, 2000, 11:00 AM
#2
Fanatic Member
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.
Not nearly so tired now...
Haven't been around much so be gentle...
-
Oct 30th, 2000, 11:27 AM
#3
Thread Starter
Junior Member
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
-
Oct 30th, 2000, 11:33 AM
#4
Fanatic Member
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
Not nearly so tired now...
Haven't been around much so be gentle...
-
Oct 30th, 2000, 12:06 PM
#5
Thread Starter
Junior Member
-
Oct 30th, 2000, 12:34 PM
#6
Thread Starter
Junior Member
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
-
Oct 31st, 2000, 04:58 AM
#7
Fanatic Member
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.
Not nearly so tired now...
Haven't been around much so be gentle...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|