Referencing a subform in docmd.open Where clause

  • Thread starter Thread starter Cmenkedi
  • Start date Start date
C

Cmenkedi

I am going to try to simplify my problem.
I have a form with custID, prodID and tankID.
I have a subform with TransactionDate and Amount.
I have made a search form where I can pick the customer and product and date.
I want to be able to open to the page with that particular date/Year.
The form and subform or linked by pageID.
I am able to open my form to the customer or Product or Tank but I am unable
to get to the certain date/year that I want. It always shows all of the dates.
Any help on this issue will be greatly appreciated.

Chris
 
To refer to a control on a subform, you must go through the parent form:

Forms![NameOfParent]![NameOfSubformControl].Form![NameOfControl]

Note that depending on how you added the form as a subform, the name of the
subform control on the parent form may be different than the name of the
form being used as a subform.

For more information, see http://www.mvps.org/access/forms/frm0031.htm at
"The Access Web"
 
Thank you but I still am having trouble referencing the subform when I open
the form to a filtered record. I want to filter the subform at the same time
I am open the from from my search form.
How do I put in my where string:
"transactionDate =" & me.lstcustomerinfo.column(3)

Where "TranscationDate" is on my subform
 
I don't believe you can use the Column collection in a query like that.

You may have to write a public function that returns the value and use that
public function in the query instead.
 
Thank you I will try doing that.

Douglas J. Steele said:
I don't believe you can use the Column collection in a query like that.

You may have to write a public function that returns the value and use that
public function in the query instead.
 
Cmenkedi said:
I am going to try to simplify my problem.
I have a form with custID, prodID and tankID.
I have a subform with TransactionDate and Amount.
I have made a search form where I can pick the customer and product
and date. I want to be able to open to the page with that particular
date/Year.
The form and subform or linked by pageID.
I am able to open my form to the customer or Product or Tank but I am
unable to get to the certain date/year that I want. It always shows
all of the dates. Any help on this issue will be greatly appreciated.

Chris

The master child relations can contain more than one field.
From memory they are separated by semicolons.
 
Back
Top