Command button to autopopulate another form

M

Michelle

Hey guys,

Here's the deal. I have a database that tracks complaints. I have the
option on another tab to attach a business to the complaints. More often
than not, the business isn't in our system (we don't bother adding one until
we get a complaint). On the business tab there is a drop down list of
businesses already available to select. If you select one, it populates the
subform with the business data (addy, website, etc) and links the business to
the complaint. However, if the business is not in the system, there is a
"add a business" command button that you can push to have the Business table
form pop-up. My question is two-fold...

1) when I add a business using the pop-up form it adds it to the business
table but the original complaint form does not refresh the list of businesses
available to select from. So I have to close the form and reopen it to attach
the newly added business to the complaint.

2) is it possible to get the complaint form to autopopulate the business it
references with the information I just inputted using the command button and
the business form? So, the scenario would be, I look through the list and
see that my business isn't in there. So I hit the "add a business" button,
type in my information and hit the exit button on the business from. That
takes me back to my complaint form where the business I just added has been
autofilled into the complaint.

Thanks a million!

Michelle
 
C

Carl Rapson

Put code in the "add a business" command button's Click event to:

1) open the popup form in Dialog mode, so the Click event's code will pause
until the popup form is closed

2) Requery the business list combo box (and position it to the newly-added
business)

3) At that point, do the same things you do when an existing business is
selected

Carl Rapson
 

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