0

I get this error when I start up an Access application. Trying to find the offending SQL statement, I put a "STOP" command in the form load event. The error appears before the STOP COMMAND is executed. I have erased all my SQL statements in the application and yet, I still get the error when I start up the program and before the form loads. I have also decompiled and recomplie the program.

Any help out there?

Best regards,

Jerry

2
  • 2
    Can you please post (some of) your code? Otherwise, how can we help? Commented Sep 12, 2019 at 16:28
  • 1
    Form_Load is the second event when a form is opened, first event is Form_Open. Did you check for code there too? Commented Sep 12, 2019 at 19:16

1 Answer 1

2

There are some possibilities where SQL statements can be in:

  • Record Source of forms/reports.
  • Control Source of combo or list boxes for example.
  • In newer Access versions also local tables can have lookup queries.
  • ...

You should take a look allover there.

Another approach is to save objects (forms, reports, tables, macros and so on) to text files, and then search in those text files for SQL statements.

As an example: This is the command to save the form AnyForm to a text file AnyForm.txt:

Application.SaveAsText acForm, "AnyForm", "c:\AnyForm.txt"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.