My DB is tracks equipment being used at events.
"frmUsage" is unbound, and has an Event drop down (working perfectly fine), and an "Asset" dropdown. I want the Asset dropdown to display the Assets ordered by AssetName, but to bound the AssetId value (to use in other parts of the form).
Asset's SQL is:
SELECT A.AssetId, A.AssetName FROM tbl_Asset AS A INNER JOIN tbl_AssetEvent
AS AE ON A.AssetId = AE.AssetId WHERE (((AE.EventId) Like
Nz(Forms!frmUsage.EventId,"*"))) GROUP BY A.AssetId, A.AssetName ORDER BY A.AssetName;
Behaviour:
How do I fix this?
Details: The combo box is configured with:
If you really need the AssetID
grouping but the query is working other than that,
then you can add it into a separate query inside and Order By
outside that one.
SELECT * FROM
(SELECT A.AssetId, A.AssetName FROM tbl_Asset AS A INNER JOIN tbl_AssetEvent
AS AE ON A.AssetId = AE.AssetId WHERE (((AE.EventId) Like
Nz(Forms!frmUsage.EventId,"*"))) GROUP BY A.AssetId, A.AssetName)
ORDER BY A.AssetName;