Re: One to many Grid Control

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Dan Freeman (spam_at_microsoft.com)
Date: 03/01/05


Date: Tue, 1 Mar 2005 09:24:28 -0800

The asterisks is "just the way it works" with 1-M relations and
grids/browses.

Filters don't play well with grids. You'd be better off avoiding them.

As Tom suggests, this would be better handled with two grids: one for
customers and one for jobs for that customer. I'd probably get rid of the
relation entirely and make the jobs a parameterized view. Every time the row
changes in customer, requery() the view and you're done.

Dan

Subhash wrote:
> I am trying to make One-to-Many Grid Control but am having a few
> problems. I created a form and added a Grid Control to the form. The
> Form's Data Environment has two tables, Customer and Jobfile.
> Relations set in Customer File to Customer Number in Jobfile and One
> to Many property of the Relations is set to .t.
>
> In the Grid Control I have included fields from both tables. When I
> run the form, values from Customer table are shown only for the first
> matching record in the jobfile. For all subsequent records, the grid
> column shows a bunch of astericks (***************). I tried placing
> following code in the Init event of the form and it works fine:
>
> Select Customer
> Do while !eof()
> ? Customer.Cust_no,Jobfile.jCust_no
> skip
> Enddo
>
> I don't understand as to why the code in the Init Event works fine
> but not in the Grid Control. I have checked several times and the
> control source of all the columns is set properly.
>
> Another thing. Filter property of the Cursor doesn't seem to be
> working. When I set the Filter property of the Jobfile to
> !Empty(Jobfile.jCust_no), it still shows all the records, even those
> customers that do not have a job set up in the Jobfile. However, when
> I set the same filter in the Init Event of the Cursor, it works fine.
>
> I am using VFP 6.0, OS Win XP Pro.
>
> Any help will be greatly appreciated.
>
> Thanks.
>
> Subhash.



Relevant Pages

  • Re: One to many Grid Control
    ... I am still don't understand though the behaviour of VFP in 1-M grid. ... > changes in customer, requerythe view and you're done. ... I created a form and added a Grid Control to the form. ... >> Relations set in Customer File to Customer Number in Jobfile and One ...
    (microsoft.public.fox.programmer.exchange)
  • Re: One to many Grid Control
    ... If you click on another customer in grid1, ... > created a form and added a Grid Control to the form. ... Customer and Jobfile. ... Filter property of the Cursor doesn't seem to be working. ...
    (microsoft.public.fox.programmer.exchange)
  • Grids and suggested edit methods
    ... Display items via a Filter, SQL statement, on a GRID that can be ... Sort on any column in the grid. ... Have played with the CursorAdapter and while it seems like a nice ... select ITEMNO, PRICE, COST, CUSTOMER, PRICEMODEL from ...
    (microsoft.public.fox.programmer.exchange)
  • Re: One to many Grid Control
    ... I want to show fields from both tables on the same grid. ... Grid Column1 Grid Column2 ... Customer 1.....Job 1 for Customer 1 ... Customer and Jobfile. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Display if count = 5
    ... criteria line of the field that is being counted, ... And, if you count something in the design grid in a query, ... if you have designed a complicated filter. ...
    (microsoft.public.access.queries)