POP-UP Form Won't Close

  • Thread starter Thread starter Dgar007
  • Start date Start date
D

Dgar007

Guest
Hi everyone,

I have the weirdest thing happening...I created a POP-UP form to open in datasheet view when you enter a text box on my main form, this works fine, but when I close the form, using the close button on the control box, it appears to close, but in fact, just moves behind the main form. Then the next time I move to the field to open the pop-up form with new criteria, it still has the old criteria. If I close it, or appear to close it, and move focus back to the text box it is correct.

The pop-up form is based on a simple select query using another textbox on my main form. I am at a loss as to why this is happening. Any suggestions would be greatly appreciated.

Thanks in advance,
 
Is there any code in that pop-up form? Especially in the On Close event?
 
Thanks for the rapid reply. No, no code behind the pop-up form what so ever.
 
Doing a little more research, I have found that instances of forms stay loaded for as long as the variable referencing the form stays in scope. When the variable goes out of scope, so does the form. The variable can go out of scope by setting the variable to nothing or closing the form containing the variable.

This now answers why it won't close, can anyone point me in the right direction as to how to get around this. The variable is a bound field on the main form and can't be set to nothing.
 
Just in case anyone wants to know, I created a global variable to reference the variable and then referenced it on the pop-up form.

This works pretty good.
 

Users who are viewing this thread

Back
Top Bottom