Multiple Listbox Error On Close Form (1 Viewer)

Toff

Registered User.
Local time
Yesterday, 19:26
Joined
Aug 10, 2010
Messages
40
Hi,

I have a form with multiple listboxes on it.

There are 4 listboxes and what you choose in the first one filters the second, choose the second and then it filters the third and so forth.

It works perfectly and fast. I like it and the users love it.

The problem I am having is when you exit the form. There are multiple errors that pop up asking for the Criteria filter that I have in the rowsource of the listboxes. It does not ask for every criteria filter, just two of them. Again the criteria filters are working perfectly, this only pops up when you exit the form.

I have no stray code or criteria anywhere as this is a pretty simple form. I've checked everything multiple times.

Anyone have any idea why this is happening?
 

SOS

Registered Lunatic
Local time
Yesterday, 17:26
Joined
Aug 27, 2008
Messages
3,517
Do you have any code in the form's On CURRENT event?
 

Toff

Registered User.
Local time
Yesterday, 19:26
Joined
Aug 10, 2010
Messages
40
Nope.

I've had this happen in the past years ago and never could figure out why then either.
 

SOS

Registered Lunatic
Local time
Yesterday, 17:26
Joined
Aug 27, 2008
Messages
3,517
Well, if you can post the database with BOGUS data, we might be able to help troubleshoot it.
 

Toff

Registered User.
Local time
Yesterday, 19:26
Joined
Aug 10, 2010
Messages
40
Thanks for the offer to help.

I need to continue on other parts of the database at the moment but will return to this bug (annoying but not show stopping) when it comes time to fine tune it all.
 

ghudson

Registered User.
Local time
Yesterday, 20:26
Joined
Jun 8, 2002
Messages
6,195
I would trap for the specific errors and ignore those errors in the event that triggers them.
 

SOS

Registered Lunatic
Local time
Yesterday, 17:26
Joined
Aug 27, 2008
Messages
3,517
I would trap for the specific errors and ignore those errors in the event that triggers them.

ghudson - read the OP's original post again. They say they are errors but they aren't. They are parameter prompts (which can't be trapped). They need to be diagnosed and dealt with.
 

Toff

Registered User.
Local time
Yesterday, 19:26
Joined
Aug 10, 2010
Messages
40
I finally had time to get back on this issue.

No clue as to why it is happening as it is not consistent. I think its a bug inherent to Access 2000 and perhaps other versions (I haven't tested other versions for it).

As a fix, on the Close Event: I did the following.

Me!
[listbox1].RowSource = Empty
Me!
[listbox2].RowSource = Empty
Me!
[listbox3].RowSource = Empty
Me!
[listbox4].RowSource = Empty

With no rowsource theres now no parameter prompts on exit.

An interesting note is that the prompts do not occur if the listboxes are on a subform. They only occur if they are on the main form.
 
Last edited:

Users who are viewing this thread

Top Bottom