Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
 
Home > Forums > Access
Access Forum


Back to Access Forum
 

Default Value Settings Upload Images   Link  
Callum Stuart 
6 days ago
Hi guys. Is there a system-wide or even database-wide setting for changing the default value in Table Design, specifically for fields assigned number data types in Table Design view, in the General tab?
Currently my system (Access 2016, Win10) defaults the default value of a Number field to 0, I would like to change that to NULL, as universally as possible, if at all. Thanks!
Kevin Yip
6 days ago
This needs to be done with VBA.  The code looks something like below.  You need to use something called ADO (ActiveX Data Objects), which you need to enable in the VBA editor's references (see picture below).  Then you run a simple SQL statement as shown to change the default of a field.  This is the only way I know how to do this other than having to manually do it in table design.  If you have lots of tables that need this, then this is a good way to automate the process.  You can even automate the creation of tables with a "CREATE TABLE" SQL statement.  Of course, changing table structure when the table already contains data could lead to data loss.

A system-wide setting would not be practical because a table has tons of settings.  It would be impractical to have a mile-long option screen to set defaults for every single table settings.
Kevin Yip
6 days ago

Kevin Yip
6 days ago
Also, the syntax of that SQL statement is not straightforward.  A long integer field in table design is referred to as INTEGER in the SQL.  An integer is called SMALLINT.  A single is called REAL.  A double is called FLOAT.  If you use SQL Server, they should look familiar.
Scott Axton
6 days ago
So basically, the answer is no.  That is a part of Access and there isn't a setting to allow you to change the behavior for new fields or databases.
Callum Stuart
6 days ago
Thanks for the info. Given the fact that I was merely trying to avoid pressing F6, DOWN, DOWN, DOWN, DEL, as I was forgetting maybe 1 in 3 times when making FK fields, I'll hard agree with Scott and come back to Kev's method when I don't get confused by the most basic of SQL SELECT statements, they're still basically dark magic to me.
Scott Axton
6 days ago
Callum if you want a little intro to SQL check out the SQL with Access.
Don't worry about it tons right now though.  You are on the right path following the courses.  
As your knowledge level increases, the Access SQL Seminars will be of benefit to you down the road.
Add a ReplyUpload an Image


Back to Access Forum Comments
 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Access Forum
Get notifications when this page is updated
 
 

Check out these other pages that may be of interest to you:

11/25/2022Application Title
11/24/2022Full HTML Editor in Access
11/24/2022Change Database Title
11/23/2022Other Names
11/21/2022Check Icon File
11/21/2022Check Icon File
11/18/2022Archive Records
11/17/2022InStr Function
11/16/2022Numbers As Text
11/15/2022Merge Tables
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
amicron@gmail.com
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn