1

I have the following query in Access:

SELECT Death.AccountNumber, Count(*) AS NumberOfRecords
FROM Death
GROUP BY Death.AccountNumber
HAVING (((Count(*))>1));

The field AccountNumber has previously been [Acc Number] but this has been updated in both the source Excel spreadsheet to which the Access table is linked and the SQL code in the query.

Nevertheless, every time I run the query Access still prompts me to "Enter Parameter Value" with the description: "Death: duplicate account numbers.Acc Number".

How do I get Access to stop displaying this prompt?

Aaa
  • 266

3 Answers3

1

Your query doesn't have anything in it about "Death: duplicate account numbers.Acc Number", so there must be some code elsewhere looking for that parameter. As long as its in the code somewhere, you will get the prompt.

NOTE: Make a copy before making doing the below.

Here is a way to find the rouge code:


  1. Open the VBA window, (Alt+F11).
  2. Then use Ctrl+H to open the Replace window.
  3. Type Acc Number in the "find what" window.
  4. Type AccountNumber in the "replace with" window.
  5. Choose Current Project
  6. Use the "Find Next" button to find any missed references.
  7. If you find a reference needing changed, click "replace".
  8. After changing all found references debug the code, run it to see if it works as you desire.

enter image description here

CharlieRB
  • 23,021
  • 6
  • 60
  • 107
0

Access will do "stacked" queries, where one query will call another, which means that the missing parameter may be in any of the stacked queries, and Access uses saved query plans, which means that sometimes the missing parameter is in a saved query plan, and Access has "Name-Autocorrect" which was a good idea that never worked correctly, but the easiest way to make a missing parameter in an Access data view is

The data-view sort order references a field that is gone.

In some circumstances, changing a field name doesn't clear or autocorrect the data-view sort order. To fix this problem on a version of Access that has a ribbon control, clear the sort order fields by clicking on the A/Z sort order button

user165568
  • 926
  • 5
  • 16
0

I had this same problem in a local table, where Access was not finding the field name in another query and kept asking for the parameter value.

I discovered that I hadn't saved the queries after renaming the field names, and once I saved them it worked as expected.

Aaron D
  • 323