Access: the code contains a syntax error

Anonymous
2019-09-24T20:04:37+00:00

When I try and place a command button on a form I get the following message:

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} vote

18 answers

Sort by: Most helpful
  1. ScottGem 68,775 Reputation points Volunteer Moderator
    2019-09-24T21:47:55+00:00

    Hi Dennis, I'm an independent adviser and will try to help.

    But I need help from you to do so. The error message you are getting indicates there is a syntax error in your coding. But to spot the error, we need to see the code. So please respond with the code behind your button. It would also help if you could step through the code and find the line that throws the error. You can try doing a Debug of the code and see if it highlights the offending line.

    Please help us help you.

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2019-09-24T22:02:03+00:00

    There is no code behind the button (that I can find). 

    This happens when I select a command button and place it on the form (In design mode). I believe that a command wizard should pop up, but I only get the pop up that I attached.

    0 comments No comments
  3. ScottGem 68,775 Reputation points Volunteer Moderator
    2019-09-25T00:26:41+00:00

    This makes little sense. You can't have a syntax error if there is no code. I would open the VBE (press Ctrl+G) ad then open the Debug menu and press Compile to find all syntax errors. I would also try a Compact and Repair.

    0 comments No comments
  4. Anonymous
    2019-09-25T01:06:51+00:00

    I will try what you ask, but I want to emphasize that the pop up happens when i place the button on the design space. I have watched a video that indicates that a wizard is supposed to be activated to help in the design of the button function. That does not happen. Can the wizard have a syntax error? I'll let you know the success of what you asked me to do. I am a novice in Access and Visual Basic.

    0 comments No comments
  5. Anonymous
    2019-09-25T01:29:25+00:00

    I ran the compile menu item and the following error came up:

    AcCmdRecordsGoToNew

    Compile error

    Invalid use of property

    1 person found this answer helpful.
    0 comments No comments