Article ID: 130336
Article Last Modified on 1/19/2007
Option Explicit
Function SetAllowZeroLength ()
Dim I As Integer, J As Integer
Dim db As Database, td As TableDef, fld As Field
Set db = CurrentDB()
'The following line prevents the code from stopping if you do not
'have permissions to modify particular tables, such as system
'tables.
On Error Resume Next
For I = 0 To db.TableDefs.Count - 1
Set td = db(I)
For J = 0 To td.Fields.Count - 1
Set fld = td(J)
If (fld.Type = DB_TEXT Or fld.Type = DB_MEMO) And Not _
fld.AllowZeroLength Then
fld.AllowZeroLength = True
End If
Next J
Next I
db.Close
End Function
? SetAllowZeroLength()
Keywords: kbhowto kbprogramming KB130336