Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid / Table Relation / Form Refresh
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00665306
Message ID:
00707542
Views:
25
Update Victory!!!!! I added goto recno('ValCalls') in ValCalls right after set key and it solved the problem!!!!!


Hi Vlad,

I have a very strange situation. I was trying to fix it all day long and didn't succeed yet. It's extremely annoying.

I have a form with 3 pages. On the first page I show info from the Methods table, on the second - from the Messages table, on the third - from the ValCalls table. Originally all three tables were related in DE of the form. In my attempts to solve this problem, I removed relationship from Methods to ValCalls. The page with ValCalls has a grid. On this grid I have a button called ShowFields. By pressing this button I invoke a form to update list of the fields...

Here is the problem. If I don't press this button and navigate using navigation buttons on the form, everything works as expected, e.g. grid shows information corresponding to the correct MethodID. But once I press this button, grid now has the mind of its own and shows information from previous (or two records back) record.

Here is the code I put in the method, which called from navigation buttons (thisform.freshen):
dodefault()
thisform.method = methods.method
lnMethodID = Methods.iMethodID
set key to range m.lnMethodID, m.lnMethodID in ValCalls
Still I observe the same anomalies behavior! :(( I think, I tried every possible combination and it still doesn't want to behave.

The form, which I invoke from the button, runs in default DS (to inherit main form DS). One thing I noticed: before I call this modal form main form DS is shown as Methods. But once I call this form, it now shows Unknown...

Can you help? I think, I'm going crazy on this form...

>Hi!
>
>I afraid I cannot help you in this question, because I rarely use data environment for real applications. Instead of that I open all tables and views in the Load event of each form. Then in Init (where parameters are passed) I apply these parameters.
>
>If you want to go with DE, ask this in separate question.
>
>>Dear Vlad,
>>
>>Tks for ur help. I will try this as well.
>>
>>Currently I hv decided to use separate forms with separte DE for both Orders as well as Shipment details. It is working quite well (so far).
>>
>>However, while loading the SHIPMENT form (which has separate DE), it shows error message:
>>
>>"Property settings will not take effect until data environment reloaded"
>>
>>Error code is 1739. I don't know why this is happening.
>>
>>When I looked at help for this error message, it suggests to execute Closetables and OpenTables methods of DE. I did that (put these statements in INIT of my form). Still it does not help.
>>
>>Some times it shows me an empty GRID on this form, I tried recreating that GRID, but no use.
>>
>>Pl let me know if you know anything about this.
>>
>>Regards
>>Shaishav
>>
>>>Hi!
>>>
>>>If you use parent-child relationship by SET RELATION command, it is a common problem with grids.
>>>
>>>With SET RELATION, each time record pointer is changed in the master table, the record pointer is child table is automatically moved to the first child record. When you use grids, during grid refreshing record pointer is moved automatically, thuis causingthe behaviour you described. Youc an solve the problem partially by remembering the current record in a child table, then restoring it just after you did all actions by using GO command to set record pointer explicitly to newly added record.
>>>
>>>Instead of SET RELATION command I would recommend you to use SET KEY filter, that works by the same way, but does not make connection with master record. You will require to change SET KEY setting for child tables each time record is changed in a master table. However, you will have much better control over grids refreshing, and no automatic record pointer changes.
>>>
>>>Hope this helps.
>>>
>>>>Dear All,
>>>>
>>>>I am using a formset with two forms. FRM_Orders and Frm_SHPT.
>>>>
>>>>I have 3 tables in my DE, CUSTOMER, ORDER and SHIPMENT.
>>>>All the tables are related in PARENT, CHILD and GRANDCHILD(?) relationship.
>>>>
>>>>CUSTOMER table has field Cust ID;
>>>>ORDER table gas fields Cust ID, Order ID;
>>>>SHIPMENT TABLE has fields Order ID, Shipment ID, Shipment_date, Shipment_qty.
>>>>
>>>>I gave a Combo Box (Cust_id) and two grids (ORDERS & SHIPMENT) on my FRM_Orders.
>>>>
>>>>FRM_Shipment is for accepting Shipment details.
>>>>
>>>>The Problem:
>>>>Whenever I add record to my SHIPMENT table, after append blank and replaceing appropriate foreign key fields (Order_ID), I display FRM_Shipment, for data entry.
>>>>
>>>>However, as soon as I display the form, the record pointer of SHIPMENT table moves to the top most record, instead of newly appended record, and displays that record data in the entry fields of FRM_Shipment form.
>>>>
>>>>I tried a lot to solve this problem, nothing works.
>>>>
>>>>Please Help.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform