DoCmd.Close causing problem?

acepayne

Registered User.
Local time
Today, 07:35
Joined
Jul 26, 2001
Messages
44
Hello,

OK, here is my best attempt at explaining what is causing me a great deal of grief!

I have a form, with a combobox and a listbox. Selecting an item from the combobox causes the listbox to be requeried. The query for the listbox contents needs the value from the selected item in the combobox.

This is all great, EXCEPT if I open this form for the first time, and then click on a close button (only code for the click event of this button is DoCmd.Close), I get a parameter query input box, looking for the combobox value. This occurs whether I select something or not.

If I re-open the form, and click the Close button, there is no parameter query box. It only occurs the first time I open and (attempt to) close the form.

Does anybody have any guesses as to what is going on?

At first glance it appears that the form is trying to fire the on_click event for the combobox (which requeries the listbox) upon closing. If this is so, how do I get around that?! If this isn't so, what's the deal??

Any help will be greatly appreciated!

Thanks,
Gord
 
The only thing that occurs to me is to check and make sure there's no extraneous code in the Form-level events (double-click on the square in the top left corner to open Form properties).

Otherwise, I'm not sure why it would do that. You might want to post the code here that you use for your combo boxes.

HTH,
David R
 
Try "Compacting and Repairing" the database. This will sometime clear up weird and unexplained things that can sometimes happen in Access.

HTH
RDH
 
Thanks for the help guys. I managed to solve the problem by rebuilding the form from scratch.

I am now wondering if the Compact and Repair would have fixed it! Oh well, too late, I already re-did it. Didn't take too long, and all is well with the world again :-)

Once again,

THANKS!
Ace
 

Users who are viewing this thread

Back
Top Bottom