About
Pricing
Community
Teams
Start Free Trial
Log in
Andy Brown
asked on
12/21/2012
Set default value for a field - via VBA
Is it possible to change the deafult value of a field (within a table), via VBA?
Microsoft Access
4
1
Last Comment
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
8/22/2022 - Mon
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
12/21/2012
Something like this:
Dim dbs As Database
Dim fld As DAO.Field
Set dbs = CurrentDb
Set fld = dbs.TableDefs("YourTableNa
me").Field
s("YourFie
ldName")
fld.
DefaultValue
= 0
Set fld = Nothing
Set dbs = Nothing
mx
ASKER CERTIFIED SOLUTION
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
12/21/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Andy Brown
12/21/2012
ASKER
MX - As always - you are a Genius - Thank you :O)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
12/21/2012
You are welcome ...
mx
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Dim dbs As Database
Dim fld As DAO.Field
Set dbs = CurrentDb
Set fld = dbs.TableDefs("YourTableNa
fld.DefaultValue = 0
Set fld = Nothing
Set dbs = Nothing
mx