Note: This code is written and intended for use in Microsoft Access and will not work in the SQL Server Query Analyzer.



SELECT dbo_RECORDS_1.FIRST_NAME & " " & dbo_RECORDS_1.LAST_NAME AS Constituent, dbo_RECORDS.ORG_NAME,

dbo_ADDRESS.ADDRESS_BLOCK, dbo_ADDRESS.CITY, dbo_ADDRESS.POST_CODE, dbo_PHONES.NUM,

dbo_TABLEENTRIES.LONGDESCRIPTION



FROM

((((((dbo_RECORDS AS dbo_RECORDS_1 INNER JOIN dbo_CONSTIT_RELATIONSHIPS ON

dbo_RECORDS_1.ID = dbo_CONSTIT_RELATIONSHIPS.CONSTIT_ID) INNER JOIN dbo_RECORDS ON

dbo_CONSTIT_RELATIONSHIPS.RELATION_ID = dbo_RECORDS.ID) INNER JOIN dbo_CONSTIT_ADDRESS ON

dbo_CONSTIT_RELATIONSHIPS.CONSTIT_ADDRESS_ID = dbo_CONSTIT_ADDRESS.ID) INNER JOIN dbo_ADDRESS ON

dbo_CONSTIT_ADDRESS.ADDRESS_ID = dbo_ADDRESS.ID) INNER JOIN dbo_CONSTIT_ADDRESS_PHONES ON

dbo_CONSTIT_ADDRESS.ID = dbo_CONSTIT_ADDRESS_PHONES.CONSTITADDRESSID) INNER JOIN dbo_PHONES

ON dbo_CONSTIT_ADDRESS_PHONES.PHONESID = dbo_PHONES.PHONESID) INNER JOIN dbo_TABLEENTRIES

ON dbo_PHONES.PHONETYPEID = dbo_TABLEENTRIES.TABLEENTRIESID



WHERE

(((dbo_CONSTIT_RELATIONSHIPS.IS_PRIMARY)=-1));

Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Our Customer Support can help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality. If you are interested in learning more about the VBA and API modules, contact your account manager.