G
Guest
I recently developed a custom parameter dialog per the excellent tutorial
found at www.fontstuff.com/access/acctut08.htm
I've followed everything to the letter but am getting odd data returns. Here
is my SQL:
SELECT tblFinishedGoods.txtProfileID, tblFinishedGoods.Brand,
tblFinishedGoods.Claim, tblFinishedGoods.FlavorStyle,
tblFinishedGoods.Category, tblFinishedGoods.CountryLanguage,
tblFinishedGoods.UnitCount, tblFinishedGoods.SubUnitCount,
tblFinishedGoods.UnitSize, tblFinishedGoods.UnitUOM,
qryProfilesAssociations.ProfilesAssociations,
qryProfilesAssociations.Description
FROM tblFinishedGoods LEFT JOIN qryProfilesAssociations ON
tblFinishedGoods.txtProfileID = qryProfilesAssociations.txtProfileID
WHERE
(((tblFinishedGoods.UnitCount)=[Forms]![frmQueryFGUnitCountUnitSize]![cbUnitCount]
Or (tblFinishedGoods.UnitCount) Like
[Forms]![frmQueryFGUnitCountUnitSize]![cbUnitCount] Is Null) AND
((tblFinishedGoods.SubUnitCount)=[Forms]![frmQueryFGUnitCountUnitSize]![cbSubUnitCount]
Or (tblFinishedGoods.SubUnitCount) Like
[Forms]![frmQueryFGUnitCountUnitSize]![cbSubUnitCount] Is Null) AND
((tblFinishedGoods.UnitSize)=[Forms]![frmQueryFGUnitCountUnitSize]![cbUnitSize]
Or (tblFinishedGoods.UnitSize) Like
[Forms]![frmQueryFGUnitCountUnitSize]![cbUnitSize] Is Null) AND
((tblFinishedGoods.UnitUOM)=[Forms]![frmQueryFGUnitCountUnitSize]![cbUnitUOM]
Or (tblFinishedGoods.UnitUOM) Like
[Forms]![frmQueryFGUnitCountUnitSize]![cbUnitUOM] Is Null))
ORDER BY tblFinishedGoods.txtProfileID;
Keep in mind this is the SQL BEFORE running the query, therefore, the Or
Like and Is Null criteria havn't been broken down by Access.
When I do run this and Access breaks down the criteria I don't get the data
return I'm expecting. For example if I type in "857" in cbUnitCount the query
returns lots of records but all of them have blank UnitCounts - "857" doesn't
display, either!
I'm stumped. Does anyone see something wrong with what I'm doing?
Thanks for your time and assistance!
found at www.fontstuff.com/access/acctut08.htm
I've followed everything to the letter but am getting odd data returns. Here
is my SQL:
SELECT tblFinishedGoods.txtProfileID, tblFinishedGoods.Brand,
tblFinishedGoods.Claim, tblFinishedGoods.FlavorStyle,
tblFinishedGoods.Category, tblFinishedGoods.CountryLanguage,
tblFinishedGoods.UnitCount, tblFinishedGoods.SubUnitCount,
tblFinishedGoods.UnitSize, tblFinishedGoods.UnitUOM,
qryProfilesAssociations.ProfilesAssociations,
qryProfilesAssociations.Description
FROM tblFinishedGoods LEFT JOIN qryProfilesAssociations ON
tblFinishedGoods.txtProfileID = qryProfilesAssociations.txtProfileID
WHERE
(((tblFinishedGoods.UnitCount)=[Forms]![frmQueryFGUnitCountUnitSize]![cbUnitCount]
Or (tblFinishedGoods.UnitCount) Like
[Forms]![frmQueryFGUnitCountUnitSize]![cbUnitCount] Is Null) AND
((tblFinishedGoods.SubUnitCount)=[Forms]![frmQueryFGUnitCountUnitSize]![cbSubUnitCount]
Or (tblFinishedGoods.SubUnitCount) Like
[Forms]![frmQueryFGUnitCountUnitSize]![cbSubUnitCount] Is Null) AND
((tblFinishedGoods.UnitSize)=[Forms]![frmQueryFGUnitCountUnitSize]![cbUnitSize]
Or (tblFinishedGoods.UnitSize) Like
[Forms]![frmQueryFGUnitCountUnitSize]![cbUnitSize] Is Null) AND
((tblFinishedGoods.UnitUOM)=[Forms]![frmQueryFGUnitCountUnitSize]![cbUnitUOM]
Or (tblFinishedGoods.UnitUOM) Like
[Forms]![frmQueryFGUnitCountUnitSize]![cbUnitUOM] Is Null))
ORDER BY tblFinishedGoods.txtProfileID;
Keep in mind this is the SQL BEFORE running the query, therefore, the Or
Like and Is Null criteria havn't been broken down by Access.
When I do run this and Access breaks down the criteria I don't get the data
return I'm expecting. For example if I type in "857" in cbUnitCount the query
returns lots of records but all of them have blank UnitCounts - "857" doesn't
display, either!
I'm stumped. Does anyone see something wrong with what I'm doing?
Thanks for your time and assistance!