Re: Where clause



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.


.



Relevant Pages

  • Re: Counting unduplicate data
    ... "Marshall Barton" wrote: ... if a client has come more than once (i.e. more than one subform is ... attendance subform's Link Master Fields property would be: ...
    (microsoft.public.access.reports)
  • Re: Editing data on subform
    ... On the subforms table there is a multi field primary key. ... subform (Client). ... My client field in the client table is indexed: Yes (No Duplicates) ...
    (microsoft.public.access.gettingstarted)
  • Re: Sub Form specific values
    ... I assume there is no parent - child relationship between the data in the ... Users need the option to update client or not. ... "Jeanette Cunningham" wrote: ... Tell us more about your parent form and subform. ...
    (microsoft.public.access.formscoding)
  • Re: Where clause
    ... My main form: [frm1 Client] ... The latter two are subform container names, ... you need to ensure that the name of the subform control on the ...
    (microsoft.public.access.forms)
  • Re: Different tabs/different tables..? Please help
    ... dump the subform on the first tab. ... subform for the client table, you can link the first subform to the second ... also, make sure you're using the name of the subform *control*, which may be ...
    (microsoft.public.access.tablesdbdesign)