Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What method to use instead of Refresh?
Message
 
 
To
27/06/2012 13:48:49
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01546511
Message ID:
01547078
Views:
49
>>>>>>
>>>>>>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.
>>>>>
>>>>>
>>>>>That's a perfect candidate for a view
>>>>
>>>>This is actually a view (if you may call it). I am using CursorAdapter.
>>>
>>>
>>>I understand - a view is a piece of cake, too boring. It's much more challenging to fiddle around with a textbox, an extra database access as a belgian collegue points out
>>> and trying to find out when the record pointer has changed.
>>
>>I hear irony in your message but not sure I understand the difference between a view and cursor created with CursorAdapter.
>
>There's no difference between and view and a cursor created with CA for this example. The idea of an unbound textbox would only work on a form. It cannot work in a grid and you'd have to end up using joins to get the customer name.

And this is, in the end, what I had to do; add the child table in the join and select the 'name' field into the CA cursor. And I ended up binding the textbox to the non-updateable field (name). So far it works.
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform