Brutalius wrote:
[Quoted Text] >Bear with me while I try to explain my problem: > >Table 1 has two columns: CustomerColumn and CityColumn. I have created a >form which allows users to add customers to Table 1. A combo box (cmbCity) >on the form allows the user to either select a city from a drop down list >(which references a list of cities in Table 2) or to type in a new City. > >On Table 1, everything works fine: the new Customer is added along with the >city, either selected from the list or newly entered. > >What I can't figure out is how to add a newly entered city to the master >list of cities in Table 2. In this way, when the next customer is added, >this city will be available in the cmbCity drop down menu.
You can use cmbCity's NotInList event to add the new city:
SQL = "INSERT INTO table1 (City) VALUES(""" & NewData & """)" DbEngine(0)(0).Execute SQL, dbFailOnError Response = acDataErrAdded
-- Marsh MVP [MS Access]
|