I'm trying to update the state capital from table STATES with a city from table CITIES. I want both , the state name and city name to be parameterized.
have this code
UPDATE STATES
SET State_capital=DLookUp("ID","CITIES","City='Los Angeles'")
WHERE State_name=[Enter State Name:];
The problem is that the City name is not parameterized in DLookUp and Access does not accept this form of the update :
UPDATE STATES
SET State_capital=(SELECT ID FROM CITIES WHERE City=[Insert city here])
WHERE State_name=[Enter State Name:];
What is the solution?Thank you !