3
votes

I am working on an Access 2007 application that was created by someone else. It has a strange, intermittent bug in which it prompts the user for query parameters when the main form is opened. The query parameters are clearly not necessary, because the error does not always occur.

The very strange "fix" to this problem is to open and close a particular module before opening the main form. Then the form opens without parameter prompts. However, of course I can't ask end users to open and close modules.

I tried using a macro to open and close the module when the database is opened. That fixes the bug, but leaves the VBA code window open, so that's no good.

Has anyone run into anything like this before? Any suggested solutions, workarounds, debugging tips, etc?

3
Maybe these missing parameters are references to controls on a form or report that is sometimes open and sometimes not. What parameter is being asked for?David-W-Fenton
It prompts for a form combo box value, which is supposed to automatically populate with the the user's Windows login.LFurness
The combo box is on the main form. There is one main form, and several subforms that display within tabs in the main form. When I open the main form and am prompted for a parameter, no other forms are open.LFurness
Is the problem that the combo box is not populating, or that you don't need the value from it in that particular context?David-W-Fenton
If I cancel out of the parameter prompts, none of the form data loads, including the combo box.LFurness

3 Answers

2
votes

If you use the "Database Documenter" feature and check "yes" to all the options, you will obtain an exhaustive report that should let you trap your problem parameter. Export this report as an .rtf or .pdf document, so it is searchable. Identify a keyword from the dialog prompt, and search on that.


Once you check the query objects using the Documenter, check your VBA code. You'll do this by stepping through code in the IDE. If the main form has subforms, they are opened with (within) the main form. And they load before the main form.

  1. Identify those subforms.
  2. Sprinkle breakpoints in their code modules (if you find a Load function, that is highly relevant).
  3. If the main form has a code module, do the same there.
0
votes

Have a look for global variables in the module that needs to be opened and closed or any variable that is referenced in the module belonging to the form.

0
votes

Access displays the Enter Parameter Value dialog box when you open an object that contains an identifier or expression that Access cannot interpret. You need to determine the source object. Here's a step-by-step guide: http://office.microsoft.com/en-us/access-help/why-does-access-want-me-to-enter-a-parameter-value-HA010274377.aspx