Hi everybody, I have a problem with a SQL statement in a combo box.
I have the following query, called qryParticipants, originating from four different tables, linked in a relationship:
ID_Course; Course Title; ID_Edition; ID_User; Surname; Name
In my combo box I want to display only people related to a determinate Course Edition (ID_Edition), so my SQL in the "Row Source" should sound like this:
where the ID_Edition variable in the WHERE clause is taken inside the current form. Instead, I don't obtain anything and, if I change the WHERE clause in this way:
I obtain all ID_User listed in the query.
What's wrong?
I have the following query, called qryParticipants, originating from four different tables, linked in a relationship:
ID_Course; Course Title; ID_Edition; ID_User; Surname; Name
In my combo box I want to display only people related to a determinate Course Edition (ID_Edition), so my SQL in the "Row Source" should sound like this:
Code:
SELECT DISTINCT qryParticipants.ID_User, [Surname] & " " & [Name] FROM qryParticipants WHERE qryParticipants.ID_Edition=" & ID_Edition & "
where the ID_Edition variable in the WHERE clause is taken inside the current form. Instead, I don't obtain anything and, if I change the WHERE clause in this way:
WHERE qryParticipants.ID_Edition= ID_Edition
I obtain all ID_User listed in the query.
What's wrong?