Re: Where clause
- From: "Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx>
- Date: Sat, 29 Dec 2007 13:20:36 -0500
Are you saying that [frm1 Client] is the name of your subform?
Subforms aren't actually opened as part of the Forms collection: you need to
refer to them via their parent form, something like:
[Forms]![ParentFormName]![frm1 Client].Form![txtClientID]
Actually, you need to ensure that the name of the subform control on the
parent form is [frm1 Client]: depending on how the form was added as a
subform, the name of the subform control may be different than the name of
the form being used as a subform. You need to use the control name.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"redFred" <redFred@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1D4C742C-B47E-4185-A90B-CFCFBECC9D20@xxxxxxxxxxxxxxxx
Main form has subform, which in turn has a subform with a combo box that I
want to use to return jobs only for the client ID of the main form (I also
have a Client ID text box on the that subform).
My row source is:
SELECT [tbl 2 Job].InvNum, [tbl 2 Job].EnterDate, [tbl 2 Job].StartDate,
[tbl 2 Job].EndDate FROM [tbl 2 Job] WHERE ((([tbl 2
Job].ClientID)=[Forms]![frm1 Client]![txtClientID])) ORDER BY [tbl 2
Job].StartDate DESC;
The combo box returns "Name#". However, pulling down the list the records
associated with the first client record in the table appear for all
clients.
I am confident my issue is the Where Clause is not correct.
Can anyone see what is wrong with my Where Clause?
BTW, on my main form ClientID is contained in text box txtClientID; on the
second subform it is contained in text box txtClientID with a control
source
of "=[Forms]![frm1 Client]![txtClientID]".
Thanks.
.
- Follow-Ups:
- Re: Where clause
- From: redFred
- Re: Where clause
- Prev by Date: Re: Displaying a stored image on a form
- Next by Date: Re: Missing something basic - Combobox updating table
- Previous by thread: Accounting with Ms Access
- Next by thread: Re: Where clause
- Index(es):
Relevant Pages
|