Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird Grid Question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00244397
Message ID:
00245854
Views:
12
Paul,

Change the table design, it is not normalized and you will be fighting an uphill battle over and over again.

Instead use a table like this;
Bikes
Field       Contents
BikeID      Integer Primary key with no meaning
Color       The color of the bike
Size        The size of the bike
SerialNo    The serial number
This table has one record for each bike. You can use sql to get the format you want by;
SELECT Color, Size, COUNT() AS Kount ;
  FROM Bikes ;
 GROUP BY 1,2 ;
  ...
That will produce your non-normalized view of the data.

Now, you can show that in a grid. When user clicks on a cell, you then need to get the color for that row, which will be the color for the record that is current, and you need to get the size which will be the size field on that record. Once you have those two values you can then;
SELECT SerialNo ;
  FROM Bikes ;
 WHERE Color = TheOneInTheOtherView ;
   AND Size = TheSizeInTheOtherView ;
 ...
This query will get a list of serail numbers of the bikes that match the color and size for the cell in the grid where the user clicked.
Previous
Reply
Map
View

Click here to load this message in the networking platform