A
antgel
Hi all,
I have a report with two listboxes on. I want the data in the listbox to
change depending on a field called articleId, which is available from the
report's bound query.
Here's the listbox SQL:
SELECT itemMaterial.id, itemMaterial.articleId, materialDetail.company,
materialDetail.model, materialDetail.colour, itemMaterial.quantity,
materialDetail.unitCost, [quantity]*[unitCost] AS lineCost FROM
materialDetail INNER JOIN itemMaterial ON
materialDetail.variationId=itemMaterial.materialId WHERE
(((itemMaterial.articleId)=Me!articleId));
However, a box comes up asking me for the value of Me!articleId - I want
this to be taken from the report's bound query! I have also tried
WHERE itemmaterial.articleid=reports!rptcosting.articleid;
but that just makes Access crash.
Then I rethought my approach. I used the above once, successfully, in a
subform when I wanted to access the main form's value. But here I have no
sub-anything, so why not make the listbox bound? So:
I tried dropping the WHERE clause, and making the listbox bound, e.g. for
the above listbox, setting controlSource to articleId, and boundColumn to 2.
But this just populates the listbox with the query results for all values of
articleId.
I must have missed something stupid. I can provide more info if necessary.
Antony
I have a report with two listboxes on. I want the data in the listbox to
change depending on a field called articleId, which is available from the
report's bound query.
Here's the listbox SQL:
SELECT itemMaterial.id, itemMaterial.articleId, materialDetail.company,
materialDetail.model, materialDetail.colour, itemMaterial.quantity,
materialDetail.unitCost, [quantity]*[unitCost] AS lineCost FROM
materialDetail INNER JOIN itemMaterial ON
materialDetail.variationId=itemMaterial.materialId WHERE
(((itemMaterial.articleId)=Me!articleId));
However, a box comes up asking me for the value of Me!articleId - I want
this to be taken from the report's bound query! I have also tried
WHERE itemmaterial.articleid=reports!rptcosting.articleid;
but that just makes Access crash.
Then I rethought my approach. I used the above once, successfully, in a
subform when I wanted to access the main form's value. But here I have no
sub-anything, so why not make the listbox bound? So:
I tried dropping the WHERE clause, and making the listbox bound, e.g. for
the above listbox, setting controlSource to articleId, and boundColumn to 2.
But this just populates the listbox with the query results for all values of
articleId.
I must have missed something stupid. I can provide more info if necessary.
Antony