Source Type: SQL
Source:
- Code: Select all Expand viewCollapse view
SELECT "C"."Name"||' '||"SC"."Name" AS "Visible", "SC"."ID"
FROM "Categories" AS "C", "Subcategories" AS "SC"
WHERE "C"."ID" = "SC"."ParentID"
ORDER BY "Visible"
Bound field: 1 (which is the second one with "SC"."ID")
The first field labeled "Visible" is the category name concatenated with a space and the subcategory name.
It can not apply to your example db because you don't have a list of countries and a list of cities.
Tools>SQL...
- Code: Select all Expand viewCollapse view
CREATE TABLE "Cities"(
"N" VARCHAR(32) NOT NULL,
"CID" INT NOT NULL,
"ID" INT GENERATED BY DEFAULT AS IDENTITY,
FOREIGN KEY ("CID") REFERENCES "Country"("country_id"));
DROP TABLE "ItalyCity";
DROP TABLE "GermanyCity";
DROP TABLE "FranceCity";
View>RefreshTables
And with this structure in place:
Linked field: the CityID in your form
Source Type: SQL
Source:
- Code: Select all Expand viewCollapse view
SELECT "C"."Name"||' '||"SC"."N AS "Visible", "SC"."ID"
FROM "Country" AS "C", "Cities" AS "SC"
WHERE "C"."ID" = "SC"."CID"
ORDER BY "Visible"
Bound field: 1 (which is the second one with "SC"."ID")
The first field labeled "Visible" is the category name concatenated with a space and the subcategory name.