Declaring Variables in Microsoft Access VBA. Dim, Public, Private, Static, TempVars, And More...

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ค. 2024
  • In this Microsoft Access tutorial, I will teach you about variables in VBA: how to declare them, how to use them, and some other cool tips.
    LEARN MORE:
    599cd.com/Variables
    LINKS:
    Intro VBA: 599cd.com/VBA
    Reserved Words: 599cd.com/ReservedWords
    Option Explicit: 599cd.com/OptionExplicit
    DEVELOPER COURSES:
    Variables: 599cd.com/ACD3
    Scope: 599cd.com/ACD4
    Global Variables: 599cd.com/ACD12
    RECOMMENDED COURSES:
    FREE Access Beginner Level 1: 599cd.com/Free1
    $1 Access Level 2: 599cd.com/1Dollar
    ADDITIONAL RESOURCES:
    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 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, #fasttips, declaring variables, dim statement, What is a variable, compile error, variable not defined, scope, static, public, private, tempvars, VBA Variables, Data Types, reserved words
    QUESTIONS:
    Please feel free to post your questions or comments below. Thanks.

ความคิดเห็น • 31

  • @thesantosfamily
    @thesantosfamily 2 หลายเดือนก่อน

    Thank you! Very helpful. I learned about variables a long time ago but couldn't remember how they work. This was a great refresher video.

  • @benjaminferland4251
    @benjaminferland4251 ปีที่แล้ว

    Hi Richard! Long time watcher here, thanks for posting this! Variables are something I struggled to understand fully, and when you say “Dim for Dimension” everything clicked into place magically! I have now built two large databases thanks to your tutorials, one for a major hospital and another for a large biotech company. Coding is not my job, but since no good software exist in my specialty field a build it yourself approach worked perfect! Thanks to you and to Microsoft for Access!!

    • @599CD
      @599CD  ปีที่แล้ว

      So glad to help. :)

  • @akokohjoel9854
    @akokohjoel9854 2 ปีที่แล้ว

    Thanks for your video on variable. I love the simple approach and illustrations used to each what variables are. Pls teach us more. Thanks once More.

    • @599CD
      @599CD  2 ปีที่แล้ว

      More on the way....

  • @rogerstrate5727
    @rogerstrate5727 2 ปีที่แล้ว

    Thanks Richard, this video gives me a better understanding of variables and how to use them properly. I love all your videos you are an awesome instructor. "Live long and prosper".

    • @599CD
      @599CD  2 ปีที่แล้ว +1

      Peace... and long life.

    • @rogerstrate5727
      @rogerstrate5727 2 ปีที่แล้ว

      @@599CD It's always great to hear from the best source I know so thanks again. And as Spock would say “Insufficient facts always invite danger.”

  • @ieteeman
    @ieteeman ปีที่แล้ว

    You are a Great Man
    There is no word invented yet can describe you

    • @599CD
      @599CD  ปีที่แล้ว

      Extraordinary? :)

  • @rabidfollower
    @rabidfollower 2 ปีที่แล้ว +3

    Yes, I've always heard that DIM stands for "dimension." In old-style BASIC, it was used to set array dimension. But nowadays, since it is not just for arrays, I've also heard that DIM stands for "declare in memory."

    • @599CD
      @599CD  2 ปีที่แล้ว +1

      I've never heard that one before... but the IT industry does love our acronyms. LOL

  • @JstnW
    @JstnW 2 ปีที่แล้ว

    Good stuff!

    • @599CD
      @599CD  2 ปีที่แล้ว

      Thanks

  • @clemdacier1402
    @clemdacier1402 4 หลายเดือนก่อน

    Thanks!

    • @599CD
      @599CD  4 หลายเดือนก่อน

      Thank you so much! :)

  • @ramprakashmaurya3236
    @ramprakashmaurya3236 2 ปีที่แล้ว

    Best 👌

    • @599CD
      @599CD  2 ปีที่แล้ว

      Thanks

  • @rshaddock
    @rshaddock ปีที่แล้ว

    I like your Star Trek references :)

    • @599CD
      @599CD  ปีที่แล้ว

      Fascinating.

  • @user-ll1wb7wd8h
    @user-ll1wb7wd8h 2 ปีที่แล้ว

    very useful.

    • @599CD
      @599CD  2 ปีที่แล้ว

      Thanks

  • @ehteshamshah
    @ehteshamshah 2 ปีที่แล้ว

    Dear Richard will u plz brief us abt Loop , End Loop etc. in Access VBA. Your method of teaching is very easy and awesome.

    • @599CD
      @599CD  2 ปีที่แล้ว +1

      Here's a video on FOR loops: th-cam.com/video/4v__MBSv6Rk/w-d-xo.html
      I'll probably do one on WHILE loops soon.

  • @WantedMobileGaming
    @WantedMobileGaming ปีที่แล้ว

    I need help with setting up a date code. So I will have something like 2D22 so the first 2 is representing the century which is 2000 the D represent the month of the year and so on how would you do something like that in VBA?

    • @599CD
      @599CD  ปีที่แล้ว

      599cd.com/ask

  • @danielthelawd2213
    @danielthelawd2213 2 ปีที่แล้ว

    Is there a way to to make textboxes turn invisible by clicking buttons in another formula?

    • @599CD
      @599CD  2 ปีที่แล้ว

      Sure set the visible property in the 599cd.com/AfterUpdate event

  • @darrenbarson3828
    @darrenbarson3828 2 ปีที่แล้ว

    Why did you use as Currency if it didn't actually make any difference? For instance, in the message box, all we got was 1000 rather than $1000. If it's dim .. as currency, why does it not change the value to currency?
    Thanks :-)

    • @599CD
      @599CD  2 ปีที่แล้ว

      If you want to see the $ then either add it, or format it as currency.

    • @darrenbarson3828
      @darrenbarson3828 2 ปีที่แล้ว

      @@599CD Thanks for the reply, but it didn't really answer my query. Are you saying that dim...as currency is the same as dim...as double for instance? Why do we dim...as anything if it doesn't change the format of whatever is output? As far as I can see, dim...as doesn't actually make any difference to calculations or outputs etc? I really don't understand why we dim...as anything at all?