Hello Access-Programmers,
SQL statements were created using the built in Access SQL builder.
In the attached database I created a split form named frmContact that uses the first sql statement below, in its RecordSource property.
This causes the subform frmContacts_subform, imbedded in the form header, to go blank.
If I remove part of the WHERE statement, that limits the split forms data sheet to those records where tblContact.CBusinessID matches the
subform's field BusinessID, the form displays all the records. (As it should without the WHERE limitation).
I am at a loss as to why this is happening. It seems the sql limitation should work.
Any thoughts?
Thank you in advance for looking into this.
SQL statements were created using the built in Access SQL builder.
In the attached database I created a split form named frmContact that uses the first sql statement below, in its RecordSource property.
This causes the subform frmContacts_subform, imbedded in the form header, to go blank.
Code:
SELECT tblContact.ContactID, tblContact.CBusinessID, tblContact.CPosition, tblContact.CFirstName, tblContact.CLastName, tblContact.CCalcName,
tblContact.CPhone, tblContact.CPhoneExt, tblContact.CFax, tblContact.CCell, tblContact.CEmail, tblContact.CImage, tblContact.CActive
FROM tblContact
[COLOR=red]WHERE (((tblContact.CBusinessID)=[Forms]![frmContact]![frmContact subform].[Form]![BusinessID]) AND ((tblContact.CActive)=True))[/COLOR]
ORDER BY tblContact.CCalcName;
If I remove part of the WHERE statement, that limits the split forms data sheet to those records where tblContact.CBusinessID matches the
subform's field BusinessID, the form displays all the records. (As it should without the WHERE limitation).
Code:
SELECT tblContact.ContactID, tblContact.CBusinessID, tblContact.CPosition, tblContact.CFirstName, tblContact.CLastName, tblContact.CCalcName,
tblContact.CPhone, tblContact.CPhoneExt, tblContact.CFax, tblContact.CCell, tblContact.CEmail, tblContact.CImage, tblContact.CActive
FROM tblContact
[COLOR=red]WHERE (((tblContact.CActive)=True))[/COLOR]
ORDER BY tblContact.CCalcName;
I am at a loss as to why this is happening. It seems the sql limitation should work.
Any thoughts?
Thank you in advance for looking into this.
Attachments
Last edited: