Рет қаралды 6,550
In this Microsoft Access tutorial, I will teach you about variable scope and visibility in VBA. We'll learn about public vs. private, the keywords dim and global, and the different scopes including procedure-level, form-level, and database-level.
Sandra from Norfork, Arkansas (a Gold Member) asks: Can I use Dim X as String on multiple buttons on one form, or does each button require a separate character? I've watched lots of videos, but have not found one yet that answers this question.
LEARN MORE:
599cd.com/Scope
PRE-REQUISITES:
Intro to VBA: 599cd.com/IntroVBA
Variables: 599cd.com/Variables
For Next Loops: 599cd.com/ForNext
RECOMMENDED COURSES:
Access Developer 4: 599cd.com/ACD4
Access Developer 31: 599cd.com/ACD31
LINKS:
Value From a Form: 599cd.com/FormName
Microsoft Scope & Visibility: docs.microsoft.com/en-us/offi...
BECOME A MEMBER:
KZbin: / @599cd
or My Site: 599cd.com/THMember
ADDITIONAL RESOURCES:
FREE Access Beginner Level 1: 599cd.com/Free1
$1 Access Level 2: 599cd.com/1Dollar
Donate to my Tip Jar: 599cd.com/TipJar
Get on my Mailing List: 599cd.com/YTML
Contact Me: 599cd.com/Contact
TechHelp: 599cd.com/TechHelp
Consulting Help: 599cd.com/DevNet
Twitter: / learningaccess
en.wikipedia.org/wiki/Microso...
products.office.com/en-us/access
microsoft.com/en-us/microsoft...
KEYWORDS
access 2016, access 2019, access 2021, access 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, #fasttips, Understanding variable scope and visibility, vba, invalid outside procedure, variable not defined, can't find the field referred to in your expression, run-time error '2465', application-defined or object-defined error, dim, private, public, global, compile invalid attribute in sub or function, procedure-level, form-level, database-level
QUESTIONS:
Please feel free to post your questions or comments below. Thanks.