Hi,
I have a main form called AddEditClients with a subform called AddEditClients. The subform has its row source set to a table called clients. The Main form has a list box that shows a list of all the clients and when a user clicks on a client the sub for is updated to show the details of that client.
My problem lies in the subform itself. It has a list box that contains all of the contracts associated with this client. Well thats what i hoped it would do. The problem i'm having is in the WHERE clause. I can't get it to compare the ClientID for the contract record against the current ClientID in the subform.
So
SELECT Contracts.ContractID, Contracts.Description, Providers.[Provider Name], Contracts.ClientID FROM Providers INNER JOIN Contracts ON Providers.ProviderID=Contracts.ProviderID WHERE (((Contracts.ClientID)=Forms![ClientDetails]![ClientID]));
doesn't work
neither does
SELECT Contracts.ContractID, Contracts.Description, Providers.[Provider Name], Contracts.ClientID FROM Providers INNER JOIN Contracts ON Providers.ProviderID=Contracts.ProviderID WHERE (((Contracts.ClientID)=Forms![AddEditClients]![ClientDetails]![ClientID]));
How do i reference a field within a subform in SQL
Help!!!
I have a main form called AddEditClients with a subform called AddEditClients. The subform has its row source set to a table called clients. The Main form has a list box that shows a list of all the clients and when a user clicks on a client the sub for is updated to show the details of that client.
My problem lies in the subform itself. It has a list box that contains all of the contracts associated with this client. Well thats what i hoped it would do. The problem i'm having is in the WHERE clause. I can't get it to compare the ClientID for the contract record against the current ClientID in the subform.
So
SELECT Contracts.ContractID, Contracts.Description, Providers.[Provider Name], Contracts.ClientID FROM Providers INNER JOIN Contracts ON Providers.ProviderID=Contracts.ProviderID WHERE (((Contracts.ClientID)=Forms![ClientDetails]![ClientID]));
doesn't work
neither does
SELECT Contracts.ContractID, Contracts.Description, Providers.[Provider Name], Contracts.ClientID FROM Providers INNER JOIN Contracts ON Providers.ProviderID=Contracts.ProviderID WHERE (((Contracts.ClientID)=Forms![AddEditClients]![ClientDetails]![ClientID]));
How do i reference a field within a subform in SQL
Help!!!