Hi,everyone
I am a newbie in terms of using CursorAdapter. My development environment is VFP9 SP2 7423 . I am having a very confusing problem.
I have a document entry UI with a parent-child table structure. The child table needs to display the record corresponding to the parent table when the parent table's record pointer moves.
In the BeforeCursorFill of the child table, I added the following code:
With this, I can get the results I want in browse mode.
The problem is in edit mode. When starting to enter a new record, I first execute the Begin Transaction command. After the records are added to the Parent table, I need to refresh the child to get an empty result set. Like this:
But my Child are not empty result sets, and it seems that CursorRefresh doesn't do anything. It still has the records that were there before the edit.
I tried to change cSelectCmd in (Child's) BefroeCursorRefresh , like this:
But the results were also disappointing and not what I was looking for.
I'm confused as to whether CursorRefresh in a VFP transaction is the result I'm seeing, whatever it is. Or is there something wrong with my approach that is causing the result to not be what I expect?
Any comments or suggestions are welcome!
Thanks in advance!
I am a newbie in terms of using CursorAdapter. My development environment is VFP9 SP2 7423 . I am having a very confusing problem.
I have a document entry UI with a parent-child table structure. The child table needs to display the record corresponding to the parent table when the parent table's record pointer moves.
In the BeforeCursorFill of the child table, I added the following code:
Code:
LPARAMETERS luseCursorSchema, lNoDataOnLoad, cSelectCmd
TEXT TO m.cSelectCmd ADDITIVE NOSHOW TEXTMERGE PreText 2
Where ParentID = ?Parent.ID
Order by NO
EndText
The problem is in edit mode. When starting to enter a new record, I first execute the Begin Transaction command. After the records are added to the Parent table, I need to refresh the child to get an empty result set. Like this:
Code:
*!* Parent
Append Blank
Child.CursorRefresh
But my Child are not empty result sets, and it seems that CursorRefresh doesn't do anything. It still has the records that were there before the edit.
I tried to change cSelectCmd in (Child's) BefroeCursorRefresh , like this:
Code:
LPARAMETERS cSelectCmd
TEXT TO m.cSelectCmd NOSHOW TEXTMERGE PreText 1 + 2 + 4 + 8
Select * From Child Where ParentID = ?Parent.ID Order by NO
ENDTEXT
I'm confused as to whether CursorRefresh in a VFP transaction is the result I'm seeing, whatever it is. Or is there something wrong with my approach that is causing the result to not be what I expect?
Any comments or suggestions are welcome!
Thanks in advance!