I've written a Query that gets info from an Option Group and some combo
boxes that returns the correct data if,in the last "AND" of the "WHERE"
I compare [AI Detail].[Assignee Short] to "RS"
When I try to compare [AI Detail].[Assignee Short] to [Forms]![Action
Item Review]![cboAssignee], a combo box populated with RS it returns
nothing. I would think that both of the following queries would be
equal. Where is my logic failing?
I've looked at this for 2 days and either haven't found a reference to
the problem or didn't recognize it when I saw it.
*************** *************** *************** *************** ***********
SQL with "RS"
*************** *************** *************** *************** ***********
SELECT DISTINCT [AI Master].[AI Key], [AI Master].[Assign Date], [AI
Master].[Expected Date], [AI Master].CompleteDate, [AI Master].[AI Title]
FROM [AI Master] INNER JOIN [AI Detail] ON [AI Master].[AI Key] = [AI
Detail].[AI Key]
WHERE ((([AI Master].[Expected Date]) Between [Forms]![Action Item
Review]![S] And [Forms]![Action Item Review]![E]) AND
((IIf([Forms]![Action Item Review]![AIStatusOptions]=2,[CompleteDate] Is
Null,(IIf([Forms]![Action Item
Review]![AIStatusOptions]=3,[CompleteDate] Is Not Null,[AI Master]![AI
Key] Is Not Null))))<>False ) AND (([AI Detail].[Assignee Short])="RS"))
ORDER BY [AI Master].[AI Key] DESC;
*************** *************** *************** *************** **********
SQL that references the Combo Box containing RS
*************** *************** *************** *************** ***********
SELECT DISTINCT [AI Master].[AI Key], [AI Master].[Assign Date], [AI
Master].[Expected Date], [AI Master].CompleteDate, [AI Master].[AI Title]
FROM [AI Master] INNER JOIN [AI Detail] ON [AI Master].[AI Key] = [AI
Detail].[AI Key]
WHERE ((([AI Master].[Expected Date]) Between [Forms]![Action Item
Review]![S] And [Forms]![Action Item Review]![E]) AND
((IIf([Forms]![Action Item Review]![AIStatusOptions]=2,[CompleteDate] Is
Null,(IIf([Forms]![Action Item
Review]![AIStatusOptions]=3,[CompleteDate] Is Not Null,[AI Master]![AI
Key] Is Not Null))))<>False ) AND (([AI Detail].[Assignee
Short])=[Forms]![Action Item Review]![cboAssignee]))
ORDER BY [AI Master].[AI Key] DESC;
I'm a Newbie! If there's a better mousetrap I'll stick my fingers in it!
Thanks in advance.
boxes that returns the correct data if,in the last "AND" of the "WHERE"
I compare [AI Detail].[Assignee Short] to "RS"
When I try to compare [AI Detail].[Assignee Short] to [Forms]![Action
Item Review]![cboAssignee], a combo box populated with RS it returns
nothing. I would think that both of the following queries would be
equal. Where is my logic failing?
I've looked at this for 2 days and either haven't found a reference to
the problem or didn't recognize it when I saw it.
*************** *************** *************** *************** ***********
SQL with "RS"
*************** *************** *************** *************** ***********
SELECT DISTINCT [AI Master].[AI Key], [AI Master].[Assign Date], [AI
Master].[Expected Date], [AI Master].CompleteDate, [AI Master].[AI Title]
FROM [AI Master] INNER JOIN [AI Detail] ON [AI Master].[AI Key] = [AI
Detail].[AI Key]
WHERE ((([AI Master].[Expected Date]) Between [Forms]![Action Item
Review]![S] And [Forms]![Action Item Review]![E]) AND
((IIf([Forms]![Action Item Review]![AIStatusOptions]=2,[CompleteDate] Is
Null,(IIf([Forms]![Action Item
Review]![AIStatusOptions]=3,[CompleteDate] Is Not Null,[AI Master]![AI
Key] Is Not Null))))<>False ) AND (([AI Detail].[Assignee Short])="RS"))
ORDER BY [AI Master].[AI Key] DESC;
*************** *************** *************** *************** **********
SQL that references the Combo Box containing RS
*************** *************** *************** *************** ***********
SELECT DISTINCT [AI Master].[AI Key], [AI Master].[Assign Date], [AI
Master].[Expected Date], [AI Master].CompleteDate, [AI Master].[AI Title]
FROM [AI Master] INNER JOIN [AI Detail] ON [AI Master].[AI Key] = [AI
Detail].[AI Key]
WHERE ((([AI Master].[Expected Date]) Between [Forms]![Action Item
Review]![S] And [Forms]![Action Item Review]![E]) AND
((IIf([Forms]![Action Item Review]![AIStatusOptions]=2,[CompleteDate] Is
Null,(IIf([Forms]![Action Item
Review]![AIStatusOptions]=3,[CompleteDate] Is Not Null,[AI Master]![AI
Key] Is Not Null))))<>False ) AND (([AI Detail].[Assignee
Short])=[Forms]![Action Item Review]![cboAssignee]))
ORDER BY [AI Master].[AI Key] DESC;
I'm a Newbie! If there's a better mousetrap I'll stick my fingers in it!
Thanks in advance.
Comment