access 2007 bug - intermittent query parameter prompts

不羁岁月 提交于 2019-12-23 16:19:39

问题


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?


回答1:


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.



回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/3337721/access-2007-bug-intermittent-query-parameter-prompts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!