sql - Access deletes query after macro exports to excel "Query must have at least one destination field" -
ms access randomly deletes sql query's content when non-vba macro exports query contents excel. initial export works , data exported excel correctly, (about 50% of time...) sql underlying query goes missing. definitely triggered export (one can before , after comparison of query).
the following site references problem , talks vba solution automaticaly rebuilds sql query. i'd prefer prevent happening rather fixing post-mortem. this forum post on bytes.com discusses issue. suggested solution not relevant.
the problem database designed in access 2007 , being used in access 2010. queries , macros involved in issue created using access 2007. these components stable in access 2007. leads me believe problem not contained within sql. sql queries simple select statements, there no inserts, drop or make table commands.
did try using expression builder represent query in access language?
double click 'criteria' in query design window, , build expression.
for example:
select table1.field1 table1 inner join table2 on table1.field1 table2.field1
this query become cleared, though worked. use expression builder build "like" expression. should this:
select table1.field1 table1 inner join table2 on table1.field1 = table2.field1 ((([table1]![field1] [table2]![field1])));
Comments
Post a Comment