Very strange problem...
I noticed that one of my listboxes is missing some records, and so I checked its underlying query (which is assigned through the listbox.rowsource VB property) to find the problem. The strange thing is that the missing records ARE present in the underlying query results!
I've flipped views back and forth thinking I must be missing something, but it's clear as day - when I look at the listbox, there are 3 records (2 records missing). When I open the SQL statement directly behind the listbox by pressing the 3 dots next to the rowsource field in the property sheet and running that query, all 5 records are there.
The listbox has multiple "OR" conditions defined in the criteria. It is always the same 2 categories of the criteria that are missing. Here is the SQL (dynamically assigned) behind the listbox:
SELECT tblPlanRevisions.RevisionID, IIf([revlevel]=1,'M.Pln',IIf([revlevel]=2,'Div',IIf([revlevel]=3,'Comm',IIf([revlevel]=4,'C.Pln','Corp')))) AS Scope, Format([revdate],'mm/dd/yy') AS [Rev Date], tblPlanRevisions.Description
FROM tblPlanRevisions
WHERE (((tblPlanRevisions.RevLevel)=4) AND ((tblPlanRevisions.fkCommunityPlanID)=43)) OR (((tblPlanRevisions.RevLevel)=3) AND ((tblPlanRevisions.fkCommunityID)=1)) OR (((tblPlanRevisions.RevLevel)=2) AND ((tblPlanRevisions.fkDivisionID)=205)) OR (((tblPlanRevisions.RevLevel)=1) AND ((tblPlanRevisions.fkMasterPlanID)="2051")) OR (((tblPlanRevisions.RevLevel)=5));
I know this looks hairy, but I'm sure its not a syntax error b/c when running this as a query, it works fine. It is only in the listbox that certain records are missing. The categories that are missing are the ones from the criteria of 'fkMasterplanid and 2015', and 'revlevel=5'.
Any ideas????
I noticed that one of my listboxes is missing some records, and so I checked its underlying query (which is assigned through the listbox.rowsource VB property) to find the problem. The strange thing is that the missing records ARE present in the underlying query results!
I've flipped views back and forth thinking I must be missing something, but it's clear as day - when I look at the listbox, there are 3 records (2 records missing). When I open the SQL statement directly behind the listbox by pressing the 3 dots next to the rowsource field in the property sheet and running that query, all 5 records are there.
The listbox has multiple "OR" conditions defined in the criteria. It is always the same 2 categories of the criteria that are missing. Here is the SQL (dynamically assigned) behind the listbox:
SELECT tblPlanRevisions.RevisionID, IIf([revlevel]=1,'M.Pln',IIf([revlevel]=2,'Div',IIf([revlevel]=3,'Comm',IIf([revlevel]=4,'C.Pln','Corp')))) AS Scope, Format([revdate],'mm/dd/yy') AS [Rev Date], tblPlanRevisions.Description
FROM tblPlanRevisions
WHERE (((tblPlanRevisions.RevLevel)=4) AND ((tblPlanRevisions.fkCommunityPlanID)=43)) OR (((tblPlanRevisions.RevLevel)=3) AND ((tblPlanRevisions.fkCommunityID)=1)) OR (((tblPlanRevisions.RevLevel)=2) AND ((tblPlanRevisions.fkDivisionID)=205)) OR (((tblPlanRevisions.RevLevel)=1) AND ((tblPlanRevisions.fkMasterPlanID)="2051")) OR (((tblPlanRevisions.RevLevel)=5));
I know this looks hairy, but I'm sure its not a syntax error b/c when running this as a query, it works fine. It is only in the listbox that certain records are missing. The categories that are missing are the ones from the criteria of 'fkMasterplanid and 2015', and 'revlevel=5'.
Any ideas????