No video

How to Use Global Variables in Microsoft Access VBA

  Рет қаралды 8,012

Sean MacKenzie Data Engineering

Sean MacKenzie Data Engineering

Күн бұрын

In this episode, we're going to take a look at how to use a global variable in Microsoft Access so that we can populate a variable in our program and have it available for consumption by our forms, reports, macros, and other code in our project. Global variables are quite handy when you need to store different things in memory as your program runs, whether it is a string, array, object, or other things.
Related Videos:
How to Use Left, Right, Mid, Instr, and Trim on Strings in MS Access and VBA
• How to Use Left, Right...
How to Use DateAdd, DateDiff, and DatePart to Calculate Dates in MS Access
• How to Use DateAdd, Da...
How to Handle Line Breaks in Microsoft Access
• How to Handle Line Bre...
How to Open a RecordSet in Access VBA and Loop Through the Records
• How to Open a RecordSe...
How to Use BOF and EOF on Recordsets in MS Access
• How to Use BOF and EOF...
How to use With.. End With in MS Access VBA
• How to use With.. End ...
How to Use Global Variables in Microsoft Access VBA
You are watching this video now!
How to Use For Next Loops in MS Access VBA
• How to Use For Next Lo...
How to Use a Do While Loop in MS Access VBA
• How to Use a Do While ...
Interested in transforming your career or finding your next gig?
system.billzon...
Want my team to do a project for you? Let's get to it!
system.billzon...
Want to get access to premium content made just for you and have a chat with me? Find me on Patreon :
/ mackenziedataengineering
Demo of my BZ RDP Cloaker:
www.patreon.co...
Want to work with me 1:1? Contact me today and book your free 20 min consultation!
Contact form you can find at www.mackenziema...
Follow me on social media:
/ mackenziedataanalytics
/ seamacke
/ seamacke
/ seamacke
/ psmackenzie
Get Microsoft Office including Access:
click.linksyne...
Got a KZbin Channel? I use TubeBuddy, it is awesome. Give it a try:
www.tubebuddy....
#msaccess #vba #dataengineering

Пікірлер: 20
@RHSdbs
@RHSdbs Жыл бұрын
Very well explained, i already know this stuff, i also use the TempVars collection in MS-Access, if a global value/variable is needed.
@seanmackenziedataengineering
@seanmackenziedataengineering Жыл бұрын
Thanks for sharing! TempVars are very handy indeed!
@hikmatmarashdeh2293
@hikmatmarashdeh2293 2 жыл бұрын
thanks a lot for your explanation and demo, it helped me a lot.
@seanmackenziedataengineering
@seanmackenziedataengineering 2 жыл бұрын
Glad that helped! Cheers
@interestingamerican3100
@interestingamerican3100 2 жыл бұрын
Commenting for the algorithm. Love the content!
@seanmackenziedataengineering
@seanmackenziedataengineering 2 жыл бұрын
Thanks!
@abdoulayetoure9965
@abdoulayetoure9965 5 ай бұрын
Thank a lot for this vidéo it help me a lot
@seanmackenziedataengineering
@seanmackenziedataengineering 5 ай бұрын
Glad to hear that!
@RamachandranS20
@RamachandranS20 2 жыл бұрын
Thank you - helped me!
@seanmackenziedataengineering
@seanmackenziedataengineering 2 жыл бұрын
Glad it helped!
@stanTrX
@stanTrX 9 ай бұрын
Thanks Sean. How can i call a module anywhere in the forms? Is there a way to call it using a shortcut (just like we can do in excel )
@seanmackenziedataengineering
@seanmackenziedataengineering 9 ай бұрын
Great question and a key aspect of using Module objects vs Form code. The Global variables, Subs, and Functions in a Module can be used all throughout your program in Forms, Queries, and Reports simply by calling them by name. For example, if you had MyCodeToRun as a Sub in your module, you can run it by just using Form code: Form > Button > right-click Properties > Events > On Click > Elipsis ... > Code Builder > Editor opens with a new subroutine, Sub ... End Sub. You can simply type in MyCodeToRun between those lines and your module Sub will run. If you have ten other forms with similar functionality, you can do the same, meaning you can use one function 10 times instead of copying and pasting tons of code. So, short answer is: Form code, Report code, and Query expressions.
@stanTrX
@stanTrX 9 ай бұрын
thanks ☺@@seanmackenziedataengineering
@gerfer6261
@gerfer6261 2 жыл бұрын
Thanks 😊 ? = is there a connector you know about in Power Automate use between Access and Excel please?
@seanmackenziedataengineering
@seanmackenziedataengineering 2 жыл бұрын
I believe you can use the Open SQL (for Access) and Excel connectors for that purpose.
@satyabanukil779
@satyabanukil779 Жыл бұрын
Sir, I have a calculative field. I want to create two variables a and b. I want to add both the variables to that calculating field. For example a is 5 and b is 2 and my result shall appear as (a + b) = 7. If it is possible, kindly make a tutorial on it. Regards
@seanmackenziedataengineering
@seanmackenziedataengineering Жыл бұрын
I don't think I ever made a program to show math results! Great idea for a video 👍
@satyabanukil779
@satyabanukil779 Жыл бұрын
@@seanmackenziedataengineering Sir all of your replies I received so far are not only of great help for learners like us but also prompt and very easy to follow. Looking forward for your tutorial as you mentioned here Sir. Regards.
@artistryartistry7239
@artistryartistry7239 2 жыл бұрын
You know your stuff, but you're not a good teacher. I'm not trying to be mean, I'm just giving honest feedback. There has to be real thinking and effort to make something clear and easy to understand, to put yourself in the mind of a person who may have no previous understanding of what you're doing. You have not applied that level of sophistication and polish to this work. As Steve Jobs said: "Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple." You haven't done that here.
@seanmackenziedataengineering
@seanmackenziedataengineering 2 жыл бұрын
All feedback is welcome. My teaching methods are not for everyone. Imagine that you're an analyst approaching a senior analyst's desk and asking about a topic. He pulls together some examples for you that he knows are good, then explains them to you. He shows the main concept only, without an encyclopedic explanation of every feature on that topic. Why? Because he knows that you're a smart analyst and, after understanding the main breakthrough will proceed to research additional ways that a technology can be used. If you have questions, you'll ask. That's what you'll find on my channel. Polished, no. Effective, yes.
How to use With.. End With in MS Access VBA
9:42
Sean MacKenzie Data Engineering
Рет қаралды 1,4 М.
Incredible Dog Rescues Kittens from Bus - Inspiring Story #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 23 МЛН
Zombie Boy Saved My Life 💚
00:29
Alan Chikin Chow
Рет қаралды 25 МЛН
wow so cute 🥰
00:20
dednahype
Рет қаралды 29 МЛН
How to Use Iif in Microsoft Access
16:59
Sean MacKenzie Data Engineering
Рет қаралды 7 М.
How to Open a RecordSet in Access VBA and Loop Through the Records
12:45
Sean MacKenzie Data Engineering
Рет қаралды 26 М.
Getting Started with MS Access Visual Basic for Applications - VBA Code-Behind and Modules
32:06
How to Get the Windows Username in MS Access
16:02
Sean MacKenzie Data Engineering
Рет қаралды 5 М.
How to Make Cascading Combo Boxes in MS Access
16:08
Sean MacKenzie Data Engineering
Рет қаралды 31 М.
How to Run Scripts and Open Other Applications from MS Access Using VBA
10:35
Sean MacKenzie Data Engineering
Рет қаралды 6 М.
How to Declare (Dim) and Set VBA Variables (use data types correctly)
7:32