0
votes

Right now I'm working on an application in access 2010 that generates letters based of data taken from a share point site. The user inputs some parameters from some combo boxes on a form. After the selection is made the user selects the type of letter they want by pressing a button.

This works fine but I'm experiencing an odd issue when I close access and reopen it later. When I open the form after starting access again I'll attempt to create a letter but instead of working like it did before the criteria prompt window appears asking for a parameter instead of taking the form values.

This happens every-time I restart access and the way I've been fixing it is by changing the names of the combo-boxes and then adjusting the queries accordingly.

This is what i was using to get the form values in the query Like [Forms]![Main Menu]![A] & "*" (A is the name of the combo box, I got tired of renaming it)

Any Idea whats going on because I'm at a loss.

Thanks in advance!

1
Whenever Access asks for a parameter (the prompt window you describe) it's because it cannot find the object you're trying to reference. Is [Main Menu] the name of the form? Is [A] the name of the control? - Mark C.
Main Menu is the name of the form and A is the name of the combo box. If i were to shut down access and return later that prompt window will return even though the names haven't changed. And before I shut down Access the application works fine, the prompt dose not show up, the query takes the parameters from the form. - user2904491

1 Answers

0
votes

If you are 100% positive that Access is finding your parameters just fine, and when Access closes they are lost, then:

  1. Do you have any backup copies of this database before the error occurred? Can you use one of them?
  2. Do you Compact & Repair the database every time you close it? This can be used somewhat as "damage control," because MS Access does have a tendency to become corrupt.
  3. Make sure the Main Menu form is open as long as the query is running. Does it close right away (aka the query isn't finding the parameter because the form is closed)?

From searching around, it seems that you aren't the only person with this problem. A known fix for people seems to have been copying all objects into a new database (which to me, sounds like the database is corrupt.) This could also mean maybe only your form is corrupt. Perhaps try to create a new form that does all of the same things that your Main Menu form does.

I'm sorry there doesn't seem to be a 'clear-cut' definitive solution for your situation.

If any VBA is involved, see below:


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.

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

From this thread