I need to change some table field properties in code and managed to change the Required and Validation Rule properties using the code below.
I also need to set the Format and Input Mask Properties for some date fields but can’t figure out how to as these properties are not supported by the technique below.
Sub DAOChangeSomeProperties()
Dim tdf As DAO.TableDef
Dim tfld As DAO.Field
For Each tdf In CurrentDb.TableDefs
If tdf.Name = “tblSurveyData” Then
For Each tfld In tdf.Fields
tfld.Required = False
tfld.AllowZeroLength = False
tfld.ValidationRule = “”
Next
End If
Next
End Sub
The reason I need to do this is there is a bug causing the error “The Property Value Is Too Large” when I try to change to properties manually in table design view. I know this is due to the vast number of fields (168!) in the table but unfortunately I cannot change this at present as the database was inherited and most of the fields seem to form part of a complicated calculation.
I’ve just read another post where someone had the same error and Charlotte suggested the record limit could come into play with this number of text fields – any suggestions on how I could check this too would gratefully received as I’ve no doubt that will propably be the next problem!