Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cross-cou;ling comboboxes in grid?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00262958
Message ID:
00263081
Views:
22
New comments at bottom.....

>>
>>Here's the challenge: I would like the user to be able to select the desired item by either of the following methods:
>>a: If product ID is known, select product ID by incremental search or dropdown list. When selected, the product ID is stored in the orderitems.productID record and the proper product description will appear in the description field.
>>b: Select the product by dropdown from the description list. When selected, the proper productID will be displayed in the productID column, and entered in the orderitems.productID record.
>>
>>I suspect that the code should be entered in the valid event of the combo boxes, and I'll be stuffing the .value property of the productID field. What I'm not sure of is matching the corresponding values of productID and description when selecting and stuffing. Will selecting one move the record pointer in the products table to the desired item? Will I need to refresh the form at that point?
>>
>>Any suggestions?
>>
>>Thanks,
>>Neil Preston
>
>This is easiest done using a parameterized [?nInvoice] and updatable SQL view of the OrderItems table. The View needs to include a field for the description. Just don't make that field updatable. The SQL example woudl look something like:
>create sql view v_orderitems as ;
>   select orderItems.*, space(40) as Descript ;
>   from OrderItems ;
>   where invoice = ?nInvoice ;
>   order by LineID
>Set the ControlSource of the 1st and 2nd columns to the Item_No and Descript respectively. In the InteractiveChange of each combobox is where I would put code to refresh the other column's Value and DisplayValue.

Thanks, Mark, for your response.

I should have mentioned that this is a modification from a database of free tables that is still being manipulated by an FPW26 app. IIRC, views don't work with free tables.

How might it be handled using free tables?

Thanks,
Neil
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform