I have one List Box in my Table_1 form, that is set to “Type of list contents: SQL” which lists an “Address”, and then writes the ID_Key of an entry from Table2, to a foreign key column in Table1.
Now I want to use the same list box to also write an entry into Table_1, column “Address”, which concatenates (I think is the term) the columns mentioned in that SQL code, as a text for later search function use.
I tried using some code found, but I’m getting a syntax error. The code is this, and I’ve pasted it in the list box SQL command:
SELECT “Name_Street” || ', nr. ’ || “Number_Street” || ', ’ || “Area_Code”, “ID_ADR” FROM “Table_2”
INSERT INTO “Table_1” VALUES (“Address”)
SELECT COALESCE(“Name_Street”, ‘’) || ', nr. ’ || COALESCE(“Number_Street”, ‘’) || ', ’ || COALESCE(“Area_Code”, ‘’) FROM “Table_2”
The error is:
SQL Status: HY000
Error code: 1000
syntax error, unexpected $end, expecting BETWEEN or IN or SQL_TOKEN_LIKE