Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Referencing a subform in docmd.open Where clause

Geek News

Referencing a subform in docmd.open Where clause
Cmenkedi 11/17/2008 7:34:01 PM
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
Re: Referencing a subform in docmd.open Where clause
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> 11/17/2008 7:54:14 PM
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"

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Cmenkedi" <Cmenkedi[ at ]discussions.microsoft.com> wrote in message
news:81C38AE9-7F86-4DF2-9E61-96508AF2D881[ at ]microsoft.com...
[Quoted Text]
>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


Re: Referencing a subform in docmd.open Where clause
Cmenkedi 11/17/2008 8:13:01 PM
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
Re: Referencing a subform in docmd.open Where clause
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> 11/17/2008 8:47:08 PM
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.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Cmenkedi" <Cmenkedi[ at ]discussions.microsoft.com> wrote in message
news:B440A71D-8062-4A05-BAE8-279FC2B17ACE[ at ]microsoft.com...
[Quoted Text]
> 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


Re: Referencing a subform in docmd.open Where clause
Cmenkedi 11/17/2008 9:14:05 PM
Thank you I will try doing that.

"Douglas J. Steele" wrote:

[Quoted Text]
> 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.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "Cmenkedi" <Cmenkedi[ at ]discussions.microsoft.com> wrote in message
> news:B440A71D-8062-4A05-BAE8-279FC2B17ACE[ at ]microsoft.com...
> > 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
>
>
>
Re: Referencing a subform in docmd.open Where clause
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 11/17/2008 9:33:47 PM
Cmenkedi wrote:
[Quoted Text]
> 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.


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net