In a form "frmAankoopArtikelen" i have a combobox ' cboLev' to let the user choose a delivery agent. After making a selection, the value of "LEVID" is stored in the textbox "LevID"
On the same form i have a listbox "lstAvailableItems" with a recordsource based on the following query.
SELECT tblArtikelen.LevID, tblArtikelen.Artnr, tblArtikelen.Levcode, tblArtikelen.Omschrijving, tblArtikelen.Voorraad, tblArtikelen.Bestelpunt, tblArtikelen.Inbestelling, tblArtikelen.Besteldatum, VERKOPEN2008.TotaalVerkocht AS [Uit VJ], Verkopen2009.TotaalVerkocht AS [Uit Nu]
FROM ((tblArtikelen INNER JOIN VERKOPEN2008 ON tblArtikelen.Artnr=VERKOPEN2008.Artnr) INNER JOIN Verkopen2009 ON tblArtikelen.Artnr=Verkopen2009.Artnr) INNER JOIN tblLeveranciers ON tblArtikelen.LevID=tblLeveranciers.LevID
WHERE (((tblArtikelen.LevID)=[Forms]![frmAankoopArtikelen]![LevID]))
ORDER BY tblArtikelen.Artnr;
I hoped to get it done this way to see the listbox populating only with the data of the articles that only the choosen delivery agent delivers. But i get no result. What's wrong with this code?
On the same form i have a listbox "lstAvailableItems" with a recordsource based on the following query.
SELECT tblArtikelen.LevID, tblArtikelen.Artnr, tblArtikelen.Levcode, tblArtikelen.Omschrijving, tblArtikelen.Voorraad, tblArtikelen.Bestelpunt, tblArtikelen.Inbestelling, tblArtikelen.Besteldatum, VERKOPEN2008.TotaalVerkocht AS [Uit VJ], Verkopen2009.TotaalVerkocht AS [Uit Nu]
FROM ((tblArtikelen INNER JOIN VERKOPEN2008 ON tblArtikelen.Artnr=VERKOPEN2008.Artnr) INNER JOIN Verkopen2009 ON tblArtikelen.Artnr=Verkopen2009.Artnr) INNER JOIN tblLeveranciers ON tblArtikelen.LevID=tblLeveranciers.LevID
WHERE (((tblArtikelen.LevID)=[Forms]![frmAankoopArtikelen]![LevID]))
ORDER BY tblArtikelen.Artnr;
I hoped to get it done this way to see the listbox populating only with the data of the articles that only the choosen delivery agent delivers. But i get no result. What's wrong with this code?