MS Access VBA Run-Time error

Anonymous
2022-08-15T18:45:55.357+00:00

Hi all,

Having a MS Access issue with a course. Wrote VBA code for my frmMainMenu for an assignment - the idea is when I open the MainMenu table, I can make changes to the "Caption" field and it will reflect on the frmMainMenu. The idea is for the buttons to work dynamically, meaning it can't be hard-coded and essentially be able to make any changes necessary. The most I had to do was create the "MainMenu" table and the references provided in the course helped us build the basic code, but I receive a run-time error code 424. I understand the parameters of DLookup, but it's essentially telling me that my object doesn't exist - can someone give me a different direction to look? I'm genuinely looking to learn VBA and this is disheartening that something that I felt was so simple is just destroying me right now.
231149-troubleshooting.png

Microsoft 365 and Office Access Development
Developer technologies Visual Basic for Applications
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Gustav 717 Reputation points MVP
    2022-08-16T09:25:28.953+00:00

    It shouldn't happen, so try to run a Compact & Repair.
    Or you may need the full syntax: Me!rptBorrower.Caption = "Some Text"

    If that doesn't help, rewrite the code lines - no copy/paste.

    Also, don't label a button as a report.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.