Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not In List - pass value from one form to another 1

Status
Not open for further replies.

tlafferty

Technical User
May 14, 2014
11
US
Hi -
I have a form named People connected to a table named People. On that form, there is a combo box named Company that has as its data source this expression to pull values from the Companies table:
Code:
SELECT [Companies].[Company_ID], [Companies].[Company] FROM Companies;

When a Company is entered in the combo box that is not in the list, I use this code to open the Companies form:
Code:
DoCmd.OpenForm "Companies", acNormal, "", "", , acNormal

There are four things I'd like to accomplish:
1. Suppress the validation message, "The text you entered is not an item in the list."
2. Open the Companies form in data entry mode.
3. Pass the value from the Company combo box on the People form to the Company text box on the Companies form.
4. On closing the Companies form, refresh the data source of the Company combo box on People form so that the new entry becomes part of the list and return focus to the Company combo box on the People form.

Also, if this isn't best practice, please feel free to make a better suggestion. Thanks in advance for your help!
 
Have a look at the NotInList event procedure of the combo.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top