This one's a bit weird and hard to describe. On my forms (any form) when I select the criteria and click the button to perform this line:
DoCmd.OutputTo acQuery, "ManOrVolQuery", "MicrosoftExcel(*.xls)", "\\fsss253001-w\ow\users\dsilva_k\KD LEAP Database\Test\SelectAllExcel.xls", True, ""
Once in a while (I can't see a pattern to it) it errors with this:
http://img453.imageshack.us/img453/4350/error1za2.jpg
Clicking Debug leads to this:
http://img453.imageshack.us/img453/2176/error2gd2.jpg
When I go to check the SQL statement, it's empty:
http://img453.imageshack.us/img453/9242/error6id1.jpg
The SQL Statement:
SELECT tblCLIENTS.*
FROM tblCLIENTS
WHERE tblCLIENTS.ManOrVol=Forms![Monthly Report]!cmbManOrVol;
The "Forms![Monthly Report]!cmbManOrVol" is a drop down box with 2 values, MAN and VOL, which gets selected during runtime.
"ManOrVolQuery" is used in the button click event of the btnManOrVol.
This problem isn't exclusive to ManOrVolQuery, it happens with all the queries. The logic and everything works fine, the sql statement just randomly dissapears -_-
Thanks in advance!