Using notInList on a variable table

bennybee

Registered User.
Local time
Today, 22:55
Joined
Jan 13, 2004
Messages
50
i have a combo box (cboCity) that changes rowsource depending on a value selected in another combo (cboCountry).

ie.
tables:
Country, City.
with values:

Country - USA, AUSTRALIA, GERMANY

and tables
USACity - Boston, NYC
AUSTRALIACity - Sydney, Brisbane
GERMANYCity - Berlin...

now i want to use the NotInList function on cboCity, so that if the user enters a city name that is not in the list, then it opens a form where they can enter in the city.
but how do i get it to open the right form for the right country - depending on the value in cboCountry.

i have used this code before:
DoCmd.OpenForm "Premises", , , , acAdd, acDialog, NewData
to open the form called "Premises"

what do i replace "Premises" with to get it to select the form corresponding with the value in cboCountry?
so if USA is selected and i enter in New Orleans that it will pop up with an already made form for entering in data to the USACity table??

:rolleyes: someone please help me?:confused:
 
I would use a single form for all the potential countries. When the country form loads, it can find the value that was chosen in the cboCountry combo box. The syntax, assuming you enter this expression in the country form, is:
some_variable=Forms!Form_Name!cboCountry

You could put that code into the OnLoad event of the country form.
 

Users who are viewing this thread

Back
Top Bottom