0
votes

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

1
Can you please post (some of) your code? Otherwise, how can we help?Adrian Mole
Form_Load is the second event when a form is opened, first event is Form_Open. Did you check for code there too?libert

1 Answers

2
votes

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"