Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / July 2007

Tip: Looking for answers? Try searching our database.

Setting the Inital Table Field Property Values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BCP - 31 Jul 2007 13:34 GMT
I would like to be able to set the default value for Allow Zero Length to
True.

For the vast majority of cases I do not was this value set to False but that
is the default.  I end up having to go through manually and setting the
switch to true for each column.  I can not seem to find the switch to set the
default to True so I do not have to do this for all of my tables.

Any help you can give will be greatly appreciated - BCP.
Douglas J. Steele - 31 Jul 2007 13:48 GMT
AFAIK, there is no switch (and I believe the default actually varies from
version to version!)

However, it's pretty straight-forward to use code to change it:

Sub SetZeroLength()
Dim dbCurr As DAO.Database
Dim tdfCurr As DAO.TableDef
Dim fldCurr As DAO.Field

   Set dbCurr = CurrentDb()
   For Each tdfCurr In dbCurr.TableDefs
       For Each fldCurr In tdfCurr.Fields
           If fldCurr.Type = dbText Or _
               fldCurr.Type = dbMemo Then
               fldCurr.AllowZeroLength = True
           End If
       Next fldCurr
   Next tdfCurr

End Sub

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I would like to be able to set the default value for Allow Zero Length to
> True.
[quoted text clipped - 7 lines]
>
> Any help you can give will be greatly appreciated - BCP.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.