Query Criteria from a Subform

Mordhel

New member
Local time
Today, 17:50
Joined
Nov 14, 2002
Messages
8
I am trying to run a query with a criteria based upon a figure which is set in a subform. :confused:

form called - ViewCompanyInfo
subform called - ViewContactInfo
textbox called - ID

I can run queries based on textboxes from the main form easily using a criteria: [Forms]![ViewCompanyInfo].[Company] which displays a particular company record.

When I try to set it so that I can display a particular record based upon an individual shown in the subform it brings up a small window asking for the value to be entered, instead of using the value held in the subform.

I have tried various criteria including: :(

[Forms]![ViewCompanyInfo]![ViewContactInfo].[ID]
[ViewCompanyInfo]![ViewContactInfo].Form![ID]
[ViewCompanyInfo]![ViewContactInfo]![Forms].[ID]
[Forms]![ViewCompanyInfo]![ViewContactInfo].[Form]![ID]
[Forms]![ViewCompanyInfo]![Subform]![ViewContactInfo].[ID]

Nothing seems to work. Can anyone please give me the criteria to enter. :mad:
 
Use the code builder with the main form open in design view, the correct references will then be made
 

Users who are viewing this thread

Back
Top Bottom