Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid: ControlSource - column vs CurrentControl?
Message
 
 
To
13/12/2006 09:41:51
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01177136
Message ID:
01177156
Views:
14
>I have a grid that I am trying to display invoice detail records in. My columns are:
>ItemCode, ItemDesc, Qty, Units, Price and Extended Amt.
>ItemCode is a 2-column combo box (0 - Dropdown) with RowSource = PRODUCTS.ItemCode,ItemDesc (so user sees a list of part numbers and descriptions). The grid's ItemDesc, Units & Price columns all point to corresponding fields in my PRODUCTS lookup table. ItemDesc and Units are really just informational - they do not need to be saved in the InvDetail table (invoice line items). But, I want the Price column to display the corresponding PRODUCTS.Price amount *and* update InvDetail.Price with this same value (from PRODUCTS). So, I assume that the Price column's ControlSource should be InvDetail.Price - right? Same for Price's Text1 ControlSource? Also, how do I initially populate the Price column with the matching PRODUCTS.Price value?

Yes, Price's column controlsource should be InvDetail.Price. You don't need to set textbox controlsource in the designer. Now, are you using buffering and tables directly?

In your combobox valid event you may put replace price with Products.Price in InvDetail. This would update price column. You may have to call colPrice.refresh() method, though I'm not certain it's necessary.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform