Access changing query criteria when saving a form's VBA code

G

Guest

Hi

Apologies if this has already been covered. I have tried searching the web
and this site, but I have been unable to find any mention of this problem. I
am using Access Version 2003 (11.6566.6568) SP2.

As the title says, Access is changing the criteria in a couple of queries
whenever I save a specific form's VBA code. The manner of the change to the
query criteria is that the criteria refers to a different form than the one
it should do. This causes the queries to fail as the newly referenced form
doesn't contain the fields expected.

The queries should refer to the form whose VBA code I am changing. However,
upon saving the VBA code (and the form itself, I suppose) the queries have
their criteria altered. An example:

Correct criteria in a query:
Forms!frmMainTab!txtDateTo

After saving the VBA code changes to frmMainTab, query says:
Forms!frmAssignCodes!txtDateTo

The queries altered are used in frmMainTab, but at no time do I change the
query or open the query or involve the query in any way. At all. As far as
I know, of course.

I can make the queries work again by editing them so they again refer to
frmMainTab, but this is not ideal as I am sure you can imagine. I have tried
Compact and Repair, exporting to a new database etc, but nothing has worked.

Any ideas as to why this is happening?

Thanks
 
G

Guest

where is the query's criteria? Is it in the criteria field of the query
design view matrix?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top