Connecting Tech Pros Worldwide Forums | Help | Site Map

Access97 - Set Table Text Field default to AllowZeroLength = True

Alan Carpenter
Guest
 
Posts: n/a
#1: Sep 5 '06
Hi.

In Access97 I can set defaults for new Fields in Tools - Options -
Tables/Queries.
I can set some Form/Report defaults in the Normal Template.

Now I need to work with AllowZeroLength = True for a while.

Is there some way I can make this happen?

I have no trouble when creating Fields from code, of course. I just want
this to take effect when manually createing or importing to a new Table.

Cheers,
Alan Carpenter

Allen Browne
Guest
 
Posts: n/a
#2: Sep 5 '06

re: Access97 - Set Table Text Field default to AllowZeroLength = True


There is no way to set an option for this in any version of Access.

You can set it programmatically, by looping through the Fields of the
TableDef:
Currentdb.TableDefs("MyTable").Fields("MyField").A llowZeroLength = True

Strange app. Other than for linking/importing bad data or from a bad source
that does not handles Nulls and Zero-Length-Strings properly, I cannot
imagine a scenario where it would be desirable to have this set to True.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Alan Carpenter" <Not@iHome.nzwrote in message
news:Xns9835D62BF7CF7NotiHomenz@yourdomain.com...
Quote:
Hi.
>
In Access97 I can set defaults for new Fields in Tools - Options -
Tables/Queries.
I can set some Form/Report defaults in the Normal Template.
>
Now I need to work with AllowZeroLength = True for a while.
>
Is there some way I can make this happen?
>
I have no trouble when creating Fields from code, of course. I just want
this to take effect when manually createing or importing to a new Table.
>
Cheers,
Alan Carpenter

MistyCat
Guest
 
Posts: n/a
#3: Sep 5 '06

re: Access97 - Set Table Text Field default to AllowZeroLength = True


"Allen Browne" <AllenBrowne@SeeSig.Invalidwrote in
news:44fd7af2$0$26745$5a62ac22@per-qv1-newsreader-01.iinet.net.au:
Quote:
There is no way to set an option for this in any version of Access.
>
You can set it programmatically, by looping through the Fields of the
TableDef:
Currentdb.TableDefs("MyTable").Fields("MyField").A llowZeroLength =
True
Thanks, Allen. That's exactly what I was doing. Well, not exactly, just the
basic and boring:
Set tdf = db.TableDefs(theTable)
For Each fld In tdf.Fields
If fld.Type = dbText Then
fld.AllowZeroLength = True
End If
Next fld

Not just "bad data or from a bad source"

Bad data AND from a bad source, and a bad destination.
It was a request from a friend who's converting some old spreadsheets.
So far he's ignoring all my advice (pleading?) and he wants a single table
with 250-odd Fields, at least a hundred of which currently share the same
name.

Oh my Codd!

Cheers,
Alan
Quote:
Strange app. Other than for linking/importing bad data or from a bad
source that does not handles Nulls and Zero-Length-Strings properly, I
cannot imagine a scenario where it would be desirable to have this set
to True.
>
Allen Browne
Guest
 
Posts: n/a
#4: Sep 6 '06

re: Access97 - Set Table Text Field default to AllowZeroLength = True


Okay, that makes good sense of it all.

Codd save us! :-)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"MistyCat" <MistyCat@home.cowrote in message
news:Xns98362C2802D8BMistyCathomeco@yourdomain.com ...
Quote:
"Allen Browne" <AllenBrowne@SeeSig.Invalidwrote in
news:44fd7af2$0$26745$5a62ac22@per-qv1-newsreader-01.iinet.net.au:
>
Quote:
>There is no way to set an option for this in any version of Access.
>>
>You can set it programmatically, by looping through the Fields of the
>TableDef:
> Currentdb.TableDefs("MyTable").Fields("MyField").A llowZeroLength =
> True
>
Thanks, Allen. That's exactly what I was doing. Well, not exactly, just
the
basic and boring:
Set tdf = db.TableDefs(theTable)
For Each fld In tdf.Fields
If fld.Type = dbText Then
fld.AllowZeroLength = True
End If
Next fld
>
Not just "bad data or from a bad source"
>
Bad data AND from a bad source, and a bad destination.
It was a request from a friend who's converting some old spreadsheets.
So far he's ignoring all my advice (pleading?) and he wants a single table
with 250-odd Fields, at least a hundred of which currently share the same
name.
>
Oh my Codd!
>
Cheers,
Alan
>
Quote:
>Strange app. Other than for linking/importing bad data or from a bad
>source that does not handles Nulls and Zero-Length-Strings properly, I
>cannot imagine a scenario where it would be desirable to have this set
>to True.

Closed Thread