Combo Box Adding Button to edit list items

J

JB10

I have a form which is designed to enter information about jobs we have
completed. It has 3 combo boxes for different types of contacts that are
pulled from different tables. I want the user to be able to select from the
list or add a new contact. I know they can right click on the drop down
arrow for the combo box and select "Edit List Items" but I really would like
to add a button next to each combo box that gives them that option. I have
tried creating a button next to it that opens up the form for the contact and
then a button on that newly opened form to save and close. However, the new
contact does not show up in the original job form unless I close out of that
and reopen it.
 
J

JB10

Also wondering if after the new list item is added, is there a way to avoid
having to select it from the list. Can it automatically be selected after
adding it?
 
T

tighe

i believe it best to requery the combo box on the close event of the form
the user adds the contact to.

Sub Form_Close()
Forms![Form_name]![Combo1].Requery
End Sub
 
J

Jeff Boyce

Have you looked into using the NotInList event and the LimitToList property?
That would do away with having to add a button and force the user to click
anything...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
P

PieterLinden via AccessMonster.com

JB10 said:
I have a form which is designed to enter information about jobs we have
completed. It has 3 combo boxes for different types of contacts that are
pulled from different tables. I want the user to be able to select from the
list or add a new contact. I know they can right click on the drop down
arrow for the combo box and select "Edit List Items" but I really would like
to add a button next to each combo box that gives them that option. I have
tried creating a button next to it that opens up the form for the contact and
then a button on that newly opened form to save and close. However, the new
contact does not show up in the original job form unless I close out of that
and reopen it.

"It has 3 combo boxes for different types of contacts that are
pulled from different tables"
Ouch. Not usually a good plan of attack. Can't you subclass the people if
you need to? (Add some 1-1 tables). How do you figure out which table to get
the contact from? Even if you are storing radically different information
about each type of person, you could still use the 1-1 approach. See Rebecca
Riordan's article on Access Web for details. www.mvps.org/access
 
B

BruceM via AccessMonster.com

This is not exactly what you were asking about, but here is a way to add a
new item to the list using the Not In List event (the combo box Limit to List
property is set to Yes):

http://www.mvps.org/access/forms/frm0015.htm
Also wondering if after the new list item is added, is there a way to avoid
having to select it from the list. Can it automatically be selected after
adding it?
I have a form which is designed to enter information about jobs we have
completed. It has 3 combo boxes for different types of contacts that are
[quoted text clipped - 6 lines]
contact does not show up in the original job form unless I close out of that
and reopen 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