Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Master - Detail form. When to update key in details?
Message
From
26/09/1997 09:56:27
Shihchau Tai
Apic Systems Pte Ltd
Singapore, Singapore
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00051730
Message ID:
00051771
Views:
35
>>Hi! I am new to VFP and really don't know what is the right way. I have asked this question before but I have not seen any reply. I appreciate if someone can help.
>>
>>I have a master-detail (1 to many) table in a form. The two tables are related via a surrogated key. In the detail table grid, AllowAddNew is set to .T. so that when user presses downarrow, he can go into next line. My question is: Which is the best event I can use to update the detail table surrogated key? It seems stupid if I use afterrowcolumnchange because while the user is browsing, it also runs through the update code. Any better idea?
>>
>>Many thanks to those who help.
>>
>>
>>Tai SC
>
>Hi, Tai SC
>I saw your previous message, but didn't think of this until today: Could you trap the down-arrow keystroke in your AfterRowColumnChange and add the surrogate key then? You would need a several steps:
>
>1. Dodefault() (I'm assuming VFP5 since VFP3 didn't have AllowAddNew).
>
>2. Check to see if your surrogate key is blank and add the correct value.
>
>3. Refresh grid if needed
>
>HTH
>Barbara

Thx for your answer. You answered many of my questions and I appreciate it a lot.

Judging from your answer, you don't seem to have used AllowAddNew before. If that is so, may I know how you add a new line to the grid in a master-detail form if the user doesn't like the idea of clicking a new button or remember a special key like {CTRL-INS} kind of thing? Can you give me some tips?


Tai
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform