How to Make a Macro in Microsoft Access

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

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

  • @SanVibonCompany
    @SanVibonCompany 6 месяцев назад +2

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

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

      You're welcome! Thanks for watching!

  • @sufiyantahir6978
    @sufiyantahir6978 9 месяцев назад +1

    Excellent presentation and explanation,Thak you very much

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

      You are welcome! Glad you liked it!

  • @outdatedgear5036
    @outdatedgear5036 Месяц назад

    This is so helpful. Thank you

    • @MyExcelOnline
      @MyExcelOnline  27 дней назад

      You're welcome! Thanks for watching!

  • @yeabuca
    @yeabuca Месяц назад

    Thank you! Brilliant!

    • @MyExcelOnline
      @MyExcelOnline  Месяц назад

      You're welcome! Glad it was helpful!

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

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

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

    • @MyExcelOnline
      @MyExcelOnline  2 месяца назад +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 2 месяца назад +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  2 месяца назад +1

      Sweet!!!

  • @revision_classesTM
    @revision_classesTM 10 месяцев назад

    👏👏👏👏

  • @AngelaBrown-xs4kd
    @AngelaBrown-xs4kd Год назад

    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.