Hello,
I am trying to have a user select an option (country name) from a combo box, then the VB code looks up the country name in the Country_List table and returns the address field associated with it (I use DLookup and it works fine). Then I try moving this field into a new table, but when I do so the value of the address variable goes blank, and I get a window that prompts me to enter the field value. I am trying to do this in order to generate a temp table that I can use later to generate a report. Please let me know If I am going about this the wrong way. Here is my code. Please note that is works for all the other variables but the one containing DLookup (STAD). If I debug, the value is there till it steps into the RunSQL.
STAD = DLookup("[Address]", "Country_List", "[Country] = '" & Country & "'")
SQL = "INSERT INTO Order_Data(Country, LCE, OEN, HosN, Address) VALUES (Country, LCE, OEN, HosN, STAD)"
DoCmd.RunSQL SQL