How to Use Macros in MS Access

Поделиться
HTML-код
  • Опубликовано: 8 янв 2025

Комментарии • 19

  • @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.

  • @manishkashikar9154
    @manishkashikar9154 3 месяца назад +1

    One of the best teachers of access in the world, Thank you sir, I love to watch your videos.

  • @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!

  • @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): ruclips.net/video/y-1Kkp_3dCw/видео.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.

  • @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: ruclips.net/video/wuyImulb_u4/видео.html
      and to use a data macro to write to other tables: ruclips.net/video/WIWrMvks1Wo/видео.html
      You can change these to suit your context. Good luck!

  • @kailynnbronken2078
    @kailynnbronken2078 Год назад +1

    this helped a lot

  • @dalskiBo
    @dalskiBo 8 месяцев назад

    Thanks Sean

  • @JemimahNjokiMuthoni
    @JemimahNjokiMuthoni 5 месяцев назад +1

    nice

  • @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!