Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What method to use instead of Refresh?
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01546511
Message ID:
01546541
Views:
41
>>>>No, I don't think it would. Why don't you just bind right after the record pointer moves. I am assuming, of course, that your code is aware of when the pointer moves.
>>>>
>>>>But then again, I'm a little confused as to why you don't bind to the table field at the get-go and then the form level refresh would handle the textbox level, unless you're actually changing the field the textbox is bound to, and again - why not do the binding there, since you KNOW things have changed.
>>>
>>>That was the point that the code is not aware when the record pointer has moved. But since I posted the initial message I decided that the only way to do it is to put some code in the Refresh method where it would be determined if record pointer has moved. Then, in that case, the "binding" occurs. So it comes back to the Refresh method but hopefully it won't slow down the application.
>>>
>>>As to your confusion. Here is why I don't/can't bind to the field. The field to which this textbox is "bound" is a PK field. But the value displayed should be a name field (another field). So I have to "seek" in the base table for the PK value and display the Name field on every record pointer move.
>>
>>Ummm...I'm really hoping this is something you inherited, but I'm gonna ask the obvious question(s).
>>
>>Why don't you just change what the textbox is bound to? Or is it a case of the user enters the PK and you seek the PK and then display the data found in the same textbox? If so, why not just add a PK entry textbox?
>
>I probably didn't explain myself correctly. Here is a very simplified example. Imagine Order Table. In the order table I will store only the Customer PK (meaningless for the user). When the Order screen is shown the text box should show Customer Name and not PK. As user navigates (goes to next, previous, etc.) records in the Order Table, the Customer Name should appear in this text box. So in the Refresh method of this textbox the code will take the PK value stored in the Order table, find the Customer record in the Customer Table and display the Customer Name. So I can't really use ControlSource of the textbox but have to do it in code.

You can use a combobox and make it look like a textbox.
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