The incredible returning query criteria!

M

markmarko

Ok, so I have an order form, which has a subform for order details. On the
subform, I went into the query and added a criteria which references a
control on the main form. I then decided against using it, and deleted the
query column that had the criteria, along with the control on the main form.

Now if I go into the main form, it asks for a parameter (for the removed
control) even though the query was change (and saved). When I go back into
the query, it still shows the criteria that I had previously deleted!

I've deleted it, altered it, etc. I save the query, and if I go directly
back in, it shows the removal of the criteria. If, however, I go to the main
form, it reverts the query to before I deleted the criteria!

Any ideas?
 
A

Amy Blankenship

Try removing the subform control, then adding it again. You will probably
need to recreate the query.

HTH;

Amy
 
A

Allen Browne

Open the query in design view, and try these ideas:

1. In the Properties box, clear anything beside the Filter and OrderBy
properties.

2. Open the Parameters box (Parameters on Query menu), and see if you need
to clear the parameter there.

3. Switch to SQL View (View menu), and copy the SQL statement. Paste into
Notepad and search for the problem text (if it's a big query.)

4. If the problem text is no-where in the query, but it still pays up:
4.1 Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
In Access 2007, it's:
Office Button | Access Options | Current Database | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

4.2. Delete the query.

4.3 Compact the database to get rid of this junk:
Tools | Database Utilities | Compact/Repair
or in Access 2007:
Office Button | Manage | Compact/Repair

4.4 Create a new query, paste the SQL statement (from Notepad) into SQL
View, and save the query.
 
Top