Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Field propertys 1

Status
Not open for further replies.

Chance1234

IS-IT--Management
Jul 25, 2001
7,871
US
Having trouble getting the following to work, any ideas

Sub TableChange()
Dim mydb As Database
Dim mytable As TableDef
Dim fieldtmp As Field
Dim FT As Field
Set mydb = CurrentDb()
Set mytable = mydb.TableDefs("speedygonzales")


For Each fieldtmp In mytable.Fields
With fieldtmp


fieldtmp.AllowZeroLength = True
End With



Next
 
This works:

Private Sub SetZeroLength()

Dim dbs As Database
Dim tdef As TableDef
Set dbs = CurrentDb
Dim fldMyField As Field
Set tdef = dbs.TableDefs("tblTest")
For Each fldMyField In tdef.Fields
If fldMyField.Type = dbText Then
fldMyField.AllowZeroLength = True
End If
Next fldMyField


End Sub Tyrone Lumley
augerinn@gte.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top