How to Make a Macro in Microsoft Access

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

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

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

    Excellent presentation and explanation,Thak you very much

  • @SanVibonCompany
    @SanVibonCompany 9 месяцев назад +3

    You have explained in a very easy way!!!! Thanks

    • @MyExcelOnline
      @MyExcelOnline  9 месяцев назад

      You're welcome! Thanks for watching!

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

    Thanks for the video.. my requirement is to automate this macro execution.. how do I schedule this access macro using Windows Scheduler or something like that?

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

      Great question! You could create a macro called autoexec and then use a windows task to open that database (autoexec macro runs automatically when the database is first opened). Make sure you close the database at the end of the autoexec. If that doesn't work, try opening a form with the autoexec macro and then putting VBA code in OnOpen even of the form.

  • @qabasalkharusi
    @qabasalkharusi 25 дней назад

    This was extremely helpful and informative,,, Thank you so much ❤

    • @MyExcelOnline
      @MyExcelOnline  24 дня назад

      Glad it was helpful! Thanks for watching!

  • @outdatedgear5036
    @outdatedgear5036 3 месяца назад

    This is so helpful. Thank you

    • @MyExcelOnline
      @MyExcelOnline  3 месяца назад

      You're welcome! Thanks for watching!

  • @yeabuca
    @yeabuca 4 месяца назад

    Thank you! Brilliant!

    • @MyExcelOnline
      @MyExcelOnline  4 месяца назад

      You're welcome! Glad it was helpful!

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

    I would like a macro which will go to a random record rather than just the available presets.

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

      Thanks for the question. You could certainly do that by creating a random number and then going to Range("A" & intRandomNumber).Select

    • @firstlast5350
      @firstlast5350 4 месяца назад +1

      @@MyExcelOnline Thanks for reply. Since question, I added button in form design view and added code to the build event you go to when right clicking on it:
      Private Sub Command4_Click()
      Dim rs As Recordset
      Dim recordCount As Long
      Dim randomRecord As Long
      ' Open the form's recordset
      Set rs = Me.RecordsetClone
      ' Move to the last record to get the count
      rs.MoveLast
      recordCount = rs.recordCount
      Randomize
      rs.MoveFirst
      ' Generate a random record number
      randomRecord = CLng((recordCount) * Rnd)

      ' Move to the randomly selected record
      rs.Move randomRecord
      Me.Bookmark = rs.Bookmark
      ' Clean up
      rs.Close
      Set rs = Nothing
      End Sub
      Code courtesy of chatgpt!

    • @MyExcelOnline
      @MyExcelOnline  4 месяца назад +1

      Sweet!!!

  • @Gamer171-y1w
    @Gamer171-y1w 2 месяца назад

    How do i use it to automatically update my monthly data

    • @MyExcelOnline
      @MyExcelOnline  2 месяца назад

      Do you open the database regularly? If so, you could have the macro run each time the database opens. Eventually the month would update that way.

  • @AngelaBrown-xs4kd
    @AngelaBrown-xs4kd 2 года назад

    Do you have a video on how to create a Macro to open a comment box

    • @MyExcelOnline
      @MyExcelOnline  Год назад

      Thanks for the question. We do not have one yet. Are you opening a form as the comment box? If so, you can use the OpenForm option in a macro to open that form for the user.

  • @revision_classesTM
    @revision_classesTM Год назад

    👏👏👏👏