Control box question

  • Follow


I have a form that opens when you run a query. (example: employee last name)
Then when I want to look up another name I want to do it from the form 
instead of closing the form.
So I added a control box to the form to run the query again.
The problem is that it opens up a new form, so if I do multiple searches I 
will have a lot of open forms.
So the the question is: Can I set up the control box to run the query and 
open it in the same form or at least close the last form when it opens a new 
one?
If so how is this done?

Thanks

Eric
0
Reply Utf 12/21/2009 3:25:01 PM

How about placing an unbound combo box at the top of the form?

Here's how:
    Using a Combo Box to Find Records
at:
    http://allenbrowne.com/ser-03.html

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Eric Starn" <EricStarn@discussions.microsoft.com> wrote in message 
news:A4EB29CB-30DC-4010-9D4F-27BFCFF48688@microsoft.com...
> I have a form that opens when you run a query. (example: employee last 
> name)
> Then when I want to look up another name I want to do it from the form
> instead of closing the form.
> So I added a control box to the form to run the query again.
> The problem is that it opens up a new form, so if I do multiple searches I
> will have a lot of open forms.
> So the the question is: Can I set up the control box to run the query and
> open it in the same form or at least close the last form when it opens a 
> new
> one?
> If so how is this done?
>
> Thanks
>
> Eric 

0
Reply Allen 12/21/2009 3:53:03 PM


Eric,

I would put the code for closing the form at the end of the code that 
re-runs the query. This is how I close my single use forms.

"Eric Starn" wrote:

> I have a form that opens when you run a query. (example: employee last name)
> Then when I want to look up another name I want to do it from the form 
> instead of closing the form.
> So I added a control box to the form to run the query again.
> The problem is that it opens up a new form, so if I do multiple searches I 
> will have a lot of open forms.
> So the the question is: Can I set up the control box to run the query and 
> open it in the same form or at least close the last form when it opens a new 
> one?
> If so how is this done?
> 
> Thanks
> 
> Eric
0
Reply Utf 12/21/2009 4:28:01 PM

"Eric Starn" <EricStarn@discussions.microsoft.com> wrote in message 
news:A4EB29CB-30DC-4010-9D4F-27BFCFF48688@microsoft.com...
>I have a form that opens when you run a query. (example: employee last 
>name)
> Then when I want to look up another name I want to do it from the form
> instead of closing the form.
> So I added a control box to the form to run the query again.
> The problem is that it opens up a new form, so if I do multiple searches I
> will have a lot of open forms.
> So the the question is: Can I set up the control box to run the query and
> open it in the same form or at least close the last form when it opens a 
> new
> one?
> If so how is this done?


Your terminology is unusual, so I'm not sure what you mean.

When you say "control box", do you mean a combo box?

What do you mean, the "form opens when you run a query"?  Normally a form 
would be based on the query, such that the query would be run (as the form's 
recordsource) when you run the form, not the other way around.  What is the 
code (or macro actions) that you use to open the form?

What is the code behind the "control box" that "runs the query again"?

-- 
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

0
Reply Dirk 12/21/2009 5:33:51 PM

3 Replies
156 Views

(page loaded in 0.049 seconds)

Similiar Articles:
















7/11/2012 11:43:35 AM


Reply: