How to Use Macros in MS Access

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ค. 2024
  • In this episode, we're going to do an introduction to Macros in Microsoft Access. If you are starting with Access, this is a good time to think about how you will automate all of the different parts of your application, especially if you are a non-programmer and want to get things done. You don't actually need to be a programmer to do many automations in MS Access. You can start with macros.. and you may be surprised at just how many different things you can do!! Let's go!
    Related Videos:
    How to Use Data Macros to Track Changes to Field Entries in MS Access
    • How to Use Data Macros...
    Data Macros in Microsoft Access
    • Data Macros in Microso...
    How to Use Macros in MS Access
    You are watching this video now!
    LinkedIn: / psmackenzie
    Join me on Patreon!
    / mackenziedataengineering
    Demo of my BZ RDP Cloaker:
    www.patreon.com/posts/how-to-...
    Check out some tech (and support my channel!):
    www.amazon.ca/shop/seanmacken...
    Want the code from this video?
    mackenziemackenzie.com/downloads
    For developers looking for a new role, check out and sign up:
    www.toptal.com/qKaO2b/worlds-...
    Needing to hire technical resources for your project? Get the best:
    www.toptal.com/qKaO2b/worlds-...
    Contact form you can find at www.mackenziemackenzie.com/
    Follow me on social media:
    / mackenziedataanalytics
    / seamacke
    / seamacke
    / seamacke
    / psmackenzie
    Get Microsoft Office including Access:
    click.linksynergy.com/fs-bin/...
    Got a TH-cam Channel? I use TubeBuddy, it is awesome. Give it a try:
    www.tubebuddy.com/seanmackenz...
    #msaccess

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

  • @zoomingby
    @zoomingby ปีที่แล้ว +4

    Sean, I can't tell you how much you've helped over the years. Truly awesome that you do this for the community. You've undoubtedly made people's lives better, easier, and more productive. Thank you.

  • @kailynnbronken2078
    @kailynnbronken2078 8 หลายเดือนก่อน +1

    this helped a lot

  • @jim27105
    @jim27105 ปีที่แล้ว +1

    Very Helpful. I went straight into VBA without learning Macros at all. Curious how you would add the # of records to the batch processed message. In other words, display “227 records processed”. Is that easily accomplished?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  ปีที่แล้ว +1

      I do remember this exact problem when I was doing macro building. If you know which table will receive the records (in this case 5M_LAND_AREA), you can use a DCount in your messagebox expression; ie:
      "Process complete! " & DCount(" & Chr(34) & "ID" & Chr(34) & ", " & Chr(34) & "5M_LAND_AREA" & Chr(34))
      If you want to know why I used Chr(34): th-cam.com/video/y-1Kkp_3dCw/w-d-xo.html
      Alternatively, you can create a list or combobox with the RecordSource set to 5M_LAND_AREA, then you could use:
      "Process complete! " & lbxChanged.RecordCount
      though, if lbxChanged is empty, it will return -1, so you can watch for that.

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

    Sean, you mentioned making a new table. What are a few situations where it's better to make a new table than to create a query that produces the same recordset?

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

      In some cases where you need to reuse a query that is particularly slow, it can be much faster to create a table one time, then join that query output into other queries for a faster result. You can also have some kind of output that is overly custom and difficult to represent with SQL. In those cases, you can write a table then run a procedure over it and update the output in a very specific way, including doing things like adding rows before the result is opened in a report, for example. A third use case is when you have a very slow networking environment and pulling data into a temporary table will have the secondary benefit of making a table in the local user's "front end" file, greatly improving performance for things like combo boxes/queries etc. (this is similar to the first example) Great question!

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

      @@seanmackenziedataengineering Ah i See, THANK YOU!!! Great examples. So helpful. Appreciate your time on this!

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

    So helpful. Please help! I've set up primarily admission, student and payment tables for a school database. What I want is to use the admission form, through vba to write admission details to both the payment and student tables when you click the admission confirmation button. All I've managed to go is just write details to the student table. Do you have any ready made video about this or how would you help?
    Thanking you in anticipation.

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

      You bet. For this use case, you can try a data macro: th-cam.com/video/wuyImulb_u4/w-d-xo.html
      and to use a data macro to write to other tables: th-cam.com/video/WIWrMvks1Wo/w-d-xo.html
      You can change these to suit your context. Good luck!

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

    Thanks Sean

  • @gerfer6261
    @gerfer6261 ปีที่แล้ว +1

    Really good 🪢
    Piggyback macros are that something I takeaway from this
    ( I think this will make life easier or getting into black hole)

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

      Oh yes 😀 before long, you'll be making super long macros to do collections of manual tasks that you were doing before. It really is incredible what you can accomplish!