![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have 20 tables with hundreds of fields that have every field set to Required: "Yes". Does anyone have a script I could run to set all these fields to not required? Going through one by one is getting really old, really fast. Thanks so much, Laura |
#3
| |||
| |||
|
|
I have 20 tables with hundreds of fields that have every field set to Required: "Yes". Does anyone have a script I could run to set all these fields to not required? Going through one by one is getting really old, really fast. |
#4
| |||
| |||
|
|
In design view, you can use DAO to step through the Tables Collection, and in each table, step through the Fields Collection and set the property of each field to not required. Googling or searching MSDN.microsoft.com or support.microsoft.com would likely turn up an example of running the collections. Larry Linson Microsoft Office Access MVP "musicloverlch" <lhowey (AT) gmail (DOT) com> wrote in message news:c49bb984-c68b-4394-9029-1e4b7d8dbb98 (AT) o21g2000prh (DOT) googlegroups.com... I have 20 tables with hundreds of fields that have every field set to Required: "Yes". Does anyone have a script I could run to set all these fields to not required? Going through one by one is getting really old, really fast. Thanks so much, Laura |
#5
| |||
| |||
|
|
"Access Developer" <accde... (AT) gmail (DOT) com> wrote in message news:8tcr2uFe4hU1 (AT) mid (DOT) individual.net... In design view, you can use DAO to step through the Tables Collection, and in each table, *step through the Fields Collection and set the property of each field to not required. *Googling or searching MSDN.microsoft.com or support.microsoft.com would likely turn up an example of running the collections. Larry Linson Microsoft Office Access MVP "musicloverlch" <lho... (AT) gmail (DOT) com> wrote in message news:c49bb984-c68b-4394-9029-1e4b7d8dbb98 (AT) o21g2000prh (DOT) googlegroups.com.... I have 20 tables with hundreds of fields that have every field set to Required: "Yes". Does anyone have a script I could run to set all these fields to not required? *Going through one by one is getting really old, really fast. Thanks so much, Laura Allen Browne has DAO code examples on his website: http://allenbrowne.com/func-DAO.html I don't recall where I picked this up from, but between this function to dis-allow zero length strings and the other information on Allen's site you should find what you need. Attribute VB_Name = "AllenBrowne" Option Compare Database Option Explicit Function FixZLS() Dim db As DAO.Database Dim tdf As DAO.TableDef Dim fld As DAO.Field Dim prp As DAO.Property Const conPropName = "AllowZeroLength" Const conPropValue = False Set db = CurrentDb() For Each tdf In db.TableDefs If (tdf.Attributes And dbSystemObject) = 0 Then If tdf.Name <> "Switchboard Items" Then For Each fld In tdf.Fields If fld.Properties(conPropName) Then Debug.Print tdf.Name & "." & fld.Name fld.Properties(conPropName) = conPropValue End If Next End If End If Next Set prp = Nothing Set fld = Nothing Set tdf = Nothing Set db = Nothing End Function ? -- Clif McIrvin (clare reads his mail with moe, nomail feeds the bit bucket :-)- Hide quoted text - - Show quoted text - |
![]() |
| Thread Tools | |
| Display Modes | |
| |