access 2010
Hi all,
I have a table (POBListT) with 3 fields: ID (PK, autonumber), FullName, Position
I have a form (POBDiveF) bound to another table (POBDiveT, 1 date field (DPRDate), 10 name fields (DiverName1-DiverName10) that selects people from this first table with a combo box. It shows only FullName and Position in the dropdown and than saves just the FullName in this field. Like it should. This way I fill my form POBDiveF with 10 people (only 1 record with 10 people per day), selected from the POB-List.
I now use an SQL UNION SELECT statement to to create a query that I can use to make a combobox dropdown list that shows only the 10 divers that were selected on the POBDiveF form.
It all works except for 1 thing: in stead of the FullNames (second column in POBListT) it returns the ID number.
How can I get it to return the FullName value?
Below the SQL statement I used
SELECT POBDiveT.Divername1, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername2, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername3, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername4, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername5, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername6, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername7, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername8, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername9, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername10, [DPRDate]
FROM POBDiveT;
Hi all,
I have a table (POBListT) with 3 fields: ID (PK, autonumber), FullName, Position
I have a form (POBDiveF) bound to another table (POBDiveT, 1 date field (DPRDate), 10 name fields (DiverName1-DiverName10) that selects people from this first table with a combo box. It shows only FullName and Position in the dropdown and than saves just the FullName in this field. Like it should. This way I fill my form POBDiveF with 10 people (only 1 record with 10 people per day), selected from the POB-List.
I now use an SQL UNION SELECT statement to to create a query that I can use to make a combobox dropdown list that shows only the 10 divers that were selected on the POBDiveF form.
It all works except for 1 thing: in stead of the FullNames (second column in POBListT) it returns the ID number.
How can I get it to return the FullName value?
Below the SQL statement I used
SELECT POBDiveT.Divername1, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername2, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername3, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername4, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername5, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername6, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername7, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername8, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername9, [DPRDate]
FROM POBDiveT
UNION SELECT POBDiveT.Divername10, [DPRDate]
FROM POBDiveT;