Sanjay,
I'd use a cursor in the grid that has 2 fields: The group field and a logical field for the checkbox. I'll call them Group and GCheck. I wouldn't try to get an updateable view.
I would populate the GCheck field by scanning the linkcustomer records for that customer as part of the grid refresh (or as part of the move to another customer).
When saving data,I'd do it in reverse. Unless you're talking more than 50 groups, I'd just delete ALL the customer records and re-add the ones that were checked in the cursor.
I used this in a similar many-to-many situation quite successfully.
You'll probably need buttons to Select All and Clear All as well.
Barbara
>A Customer table has customer information.
>A Group table has a group information.
>A group can have multiple customers.
>A customer can have multiple groups.
>So I created a table which links both of them.
>In this table I am storing Customers and GroupCID and there is No Primary Key (PK is linkcustomerCID+linkGroupCID) because many records will be deleted and added and not updated.
>On the customer form I have provided a Grid with GroupTextbox which shows all the groups and a checkbox where user can select/deselect group by clicking the checkbox. I can not change this interface because client wants this way.
>Same logic is for Group Form.
>(1) How do I refresh this grid so that correct values of checkboxes appear, I mean ticked where there is a groupCID in linkCustomerGroup Table or blank when there is no GroupCID of GroupTextBox (grouptextbox shows only groupname and not groupcid, this is also the problem.
>(2) When User selects/deselects more than one group I will have to either add multiple records or delete multiple records
>(3)Will it be possible to create a single view which will show all the groups and update the Linktable. I tried it with OUTERJOIN View (All records from GroupTable +records from linktable which has a matching CID) but whenever I replace .NULL. value with actual Valid Value VFP pops up error message UPDATE Conflict.
>(4) what will be the coding part on the grid or save method.
>
>Sanjay Chavda
>sanjay@telebot.net
>Any Help