Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record Pointer
Message
From
12/01/2000 11:07:11
 
 
To
11/01/2000 19:07:17
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00316526
Message ID:
00316996
Views:
15
>Erik,
>
>The code on the command button is:
>Select datarept
>Append Blank
>ThisForm.Refresh
>ThisForm.Unitextb1.Setfocus
>
>Then I type in the data in Unitextb1 and press enter key to cause it to loose focus. At this time I desire to double click the first header in my grid which displays child records. I have code on the double click event as so:
>Select edrsubmi
>Append Blank
>Replace edr_no With ThisForm.Unitextb1.Value
>Replace edr_subno With 1
>
>The trouble is that the record I add is really not in focus until I click on the previous nav button to move the record pointer back one record. As I said it seems that after I type in the record data the pointer is past the EOF. Another thing is if I click the next record nav button I get an error that I am past last record.
>
>Thanks,
>S. Dyke

Just a thought here. I have experienced this problem when adding records to a grid that has focus. I believe this has to do with two things. One, you probably have buffering set which means that any appended, uncommited records have a negative record number and although the grid will handle these it is a little funky about it and even funkier if it is a child table. Two, and this is a guess, grids are a little fragile about initiating, getting focus and refreshing when they already have focus. The upshot of this is when I fought this one I commited records to the table upon the append and then refreshed the grid and then the form. ie:

From object in grid
insert into child with keyfield = parent.value
=tableupdate(.t.)
this.parent.refresh
thisform.refresh


WARNING - This is not what I would call good programming. In fact, due to the above problems, I would append the child from the Unitextb1.valid. But if you need to do it from the grid something like the above should help.
Previous
Reply
Map
View

Click here to load this message in the networking platform