>
>I have an order entry system. There are 3 tables, Orders, Order_Items, and Inventory.
>
>Question 1:
>
>The Orders is a one-to-many into Order_Items.
>Order_Items has a foreign key, ItemId, into inventory/
>
>I need to show a grid of order items for the selected
>customer. The grid should allow the user to add, change
>or remove the order line items.
>
>The line items can be picked from the inventory table.
>
>So had had:
>>
>
>CREATE SQL VIEW v_Orders;
>AS SELECT * FROM Order_Items;
>WHERE ParentId = ?cCustomerId;
>Kevin, basically, you need 2 grids in the form:
Top grid contains Orders info, lower grid contains Order Items info from your v_orders view (I think it should be "v_items", BTW). In Orders grid.AfterRowColChange you have to requery your items view.
REQUERY("v_items")
this.parent.Griditems.Refresh()
Your inventory lookup may be in a separate Modal form, or pop-up container with the grid with incremental search to select the inventory items.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison