Re: About lookup fields..

From: Andrew (abaylis_nos_at_spamcop.net)
Date: 03/19/05

  • Next message: Richard Caruana: "Re: How to re-populate DBgrid after doing a search"
    Date: Sun, 20 Mar 2005 08:33:26 +1100
    
    

    "kolja2003" <kolja2003@list.ru> wrote in message
    news:423b3368@newsgroups.borland.com...
    >I want to sort along lookup field which I created and added to ADOQuery in
    > Delphi.
    > Then I enter statement: ADOQuery1.Sort:= 'Nameoflookupfield'.
    > And what I get the error message: "Class EOLEexception with message <Item
    > cann't be found in collection correponding with requested name or
    > ordonal>".
    >
    >

    That's because the Sort routine relies upon the data fields provided by the
    query, not any others. The only way (I can think of) that you can do this
    is if you modify your query using a JOIN to bring in the lookup data as part
    of the query, then sort on that.

    HTH

    Andrew


  • Next message: Richard Caruana: "Re: How to re-populate DBgrid after doing a search"

    Relevant Pages

    • Re: query error
      ... query which is company?? ... This is another of the problems with the Lookup Field. ... If you *join* the company table to the client table, you will be able to sort ... John W. Vinson [MVP] ...
      (microsoft.public.access.queries)
    • Re: Make Table Query - Sorting Errors
      ... Dim OutputTable As DAO.Recordset ... The query to concatenate the CAMPNO values will need to be LOOKING at the ... If you post the query you are using to do this, I beleive we can get it to ... Is there a command that I can use in the module code to first sort the ...
      (microsoft.public.access.queries)
    • Re: Make Table Query - Sorting Errors
      ... You sort in a query, ... You can do a compound sort in a query. ... "Tom Ellison" wrote: ... resulting table only has one record for each value of "CAMPNO". ...
      (microsoft.public.access.queries)
    • Re: Query doesnt always sort
      ... You have to use a query to sort the data in to your required order and then ... Access MVP 2002-2005, 2007 ... University of Maryland Baltimore County ... How do I impose a sort on the datasheet view? ...
      (microsoft.public.access.queries)
    • Re: Make Table Query - Sorting Errors
      ... sorted, it will sort them as they arrive. ... you query them, why is this of any concern to you? ... correctly on the field CAMPNO. ... "Duane Hookom" wrote: ...
      (microsoft.public.access.queries)