BergJC
asked on
Default values for Access fields
Is there any way to set the default value of a field when you use the ALTER TABLE command to create new fields on an Access table? Currently it defaults to null, but I need it to be zero.
Would it be possible to use DAO for this? It's a lot easier that way. Then after you create the fields in the table, you can select the Field object from the Fields collection of the table and set it's Default property.
ASKER
I don't know if DAO would work...could you show me how this could be done?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You should replace "PostalCode" with your fieldName
tdfMyTable.Fields!YourFiel dNAmeHere. DefaultVal ue = 0 ' assume it is a number field
Regards
Dalin
tdfMyTable.Fields!YourFiel
Regards
Dalin