Weird Listbox Criteria Error

G

Guest

Hi,

I have an unbound box ([FindItem]) that I am using as criteria on my listbox.

Now while the form is open everything is working just fine however when the
form is closed the listbox criteria statement comes up with ([Forms]![frm POs
By 3V Code]![FindItem]) which is my unbound box I am using for my search term.

Again, this only comes up when the form is closed yet the form works
perfectly while it is open.

Somehow the form is thinking that the unbound box ([Forms]![frm POs By 3V
Code]![FindItem]) doesn't exist when the form is being closed.

Does anyone have any ideas to fix it?
 
D

Douglas J. Steele

That's how it's intended to work. You cannot refer to a control on a form
that isn't open (and Access won't open the form for you).
 
G

Guest

I didn't explain it clearly then.

Everything is contained in the same form and the form works perfectly while
the form is open.

There is an unbound box that I am using for the user to type in a search
term which then will filter the list box located under it. The user then
selects the item in the list box they wish to see detail on. It all works
very well at this point.

Now when the form is closed, the ([Forms]![frm POs By 3V Code]![FindItem]),
which is the unbound search box, comes up as if the form is running a query
and the location doesn't exist or is misspelled.

Its just strange that an error ONLY pops up when I try to close the form.



Douglas J. Steele said:
That's how it's intended to work. You cannot refer to a control on a form
that isn't open (and Access won't open the form for you).

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lythandra said:
Hi,

I have an unbound box ([FindItem]) that I am using as criteria on my
listbox.

Now while the form is open everything is working just fine however when
the
form is closed the listbox criteria statement comes up with ([Forms]![frm
POs
By 3V Code]![FindItem]) which is my unbound box I am using for my search
term.

Again, this only comes up when the form is closed yet the form works
perfectly while it is open.

Somehow the form is thinking that the unbound box ([Forms]![frm POs By 3V
Code]![FindItem]) doesn't exist when the form is being closed.

Does anyone have any ideas to fix it?
 
D

Douglas J. Steele

Is there any code in your form's Close or Unload event?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lythandra said:
I didn't explain it clearly then.

Everything is contained in the same form and the form works perfectly
while
the form is open.

There is an unbound box that I am using for the user to type in a search
term which then will filter the list box located under it. The user then
selects the item in the list box they wish to see detail on. It all works
very well at this point.

Now when the form is closed, the ([Forms]![frm POs By 3V
Code]![FindItem]),
which is the unbound search box, comes up as if the form is running a
query
and the location doesn't exist or is misspelled.

Its just strange that an error ONLY pops up when I try to close the form.



Douglas J. Steele said:
That's how it's intended to work. You cannot refer to a control on a form
that isn't open (and Access won't open the form for you).

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lythandra said:
Hi,

I have an unbound box ([FindItem]) that I am using as criteria on my
listbox.

Now while the form is open everything is working just fine however when
the
form is closed the listbox criteria statement comes up with
([Forms]![frm
POs
By 3V Code]![FindItem]) which is my unbound box I am using for my
search
term.

Again, this only comes up when the form is closed yet the form works
perfectly while it is open.

Somehow the form is thinking that the unbound box ([Forms]![frm POs By
3V
Code]![FindItem]) doesn't exist when the form is being closed.

Does anyone have any ideas to fix it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top