Essentially I am trying to find a way to display different sets of data in a combo box dependant on a null value. What I would like to do is display the Cities associated with a certain contact using the following code
SELECT tblCities.CityID, tblCities.CityName
FROM tblCities
WHERE (((tblCities.CityID)=[forms]![frmContact]![txtCityID]))
ORDER BY tblCities.CityName;
What I would like to do is if their is no city associated with a contact, or when entering a new contact I would like to display all the cities without any filtering using something like
SELECT tblCities.CityID, tblCities.CityName
FROM tblCities
ORDER BY tblCities.CityName;
Now I think I need something like
if CityID IS NOT.NULL --> use first SQL statement if it is NULL use second but I don't know how to do this in SQL or VB?
Probably a quick one for those in the know
Thanks