Senin, 07 November 2016

[MS_AccessPros] Combo box Row Source Distinct Query

 

Greetings All,

The following SQL is a saved query that is the row source for a combo box on a form:

SELECT DISTINCT tblCustomersMain.[Group No], tblCustomersMain.[Account Name], tblCustomersMain.[Contact First Name], tblCustomersMain.CustomerID
FROM tblCustomersMain INNER JOIN tblExpectedTotals ON (tblCustomersMain.CustomerID = tblExpectedTotals.[Customer ID]) AND (tblCustomersMain.[Group No] = tblExpectedTotals.[Group No])
WHERE (((tblCustomersMain.[Excluded from Payments])=False))
ORDER BY tblCustomersMain.[Account Name], tblCustomersMain.[Group No];

When I run the query from the query designer, I get the expected result of only the rows from tblCustomersMain that have a related row in tblExpectedTotals, a total of 294 rows.

However, as the rows source for the combo box, it is returning Group No from tblCustomersMain that do not have a related row in tblExpectedTotals, a total of 330 rows.

Am I missing something? This is Access 2007 on Windows 7 Enterprise.

Darrell

 


The information contained in this communication is highly confidential and is intended solely for the use of the individual(s) to whom this communication is directed. If you are not the intended recipient, you are hereby notified that any viewing, copying, disclosure or distribution of this information is prohibited. Please notify the sender, by electronic mail or telephone, of any unintended receipt and delete the original message without making any copies.

Blue Cross Blue Shield of Michigan and Blue Care Network of Michigan are nonprofit corporations and independent licensees of the Blue Cross and Blue Shield Association.

__._,_.___

Posted by: "Embrey, Darrell" <DEmbrey@bcbsm.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Poskan Komentar