Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid order - how to prevent jumping?
Message
From
02/05/2001 14:43:33
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00502661
Message ID:
00502677
Views:
14
>>>Hello everyone,
>>>
>>>I have a form with two grids. The main table is BldMstr, the other is Lender. BldMstr is ordered by lName. I scroll through the grid and if I find lender code, which could be changed, I dblclick on the Lender grid and this action puts new Lender code into Lender field and assign NULL to lname. It also calls tisform.Next() method, which moves to the next record. Now you can easily see my problem: I assign NULL, so the record pointer jumps to the top, which is inconvenient for the user. What would be the best and simplest way to move to the next record, which was next before assigning NULL.
>>>
>>>Thanks in advance.
>>
>>Been a while since I worked with grids...but whereever you are doing the insert, I would think you'd have to capture the record number of the record the user is on before the insert is performed. That way you could return and SKIP to the next one.
>>
>>One way to do this might be thru the grid.BeforeRowColChange method (put code there to save the RECNO() to a form property).
>>
>>Hope that helps...
>
>Hi Daniel,
>
>Recno would not help in my case. The table is in the order, so when I skip, I go to the next record, which is in the order sequence, not in the natural order.

Isn't that what you want? Going back to the previous record number and SKIPping forward (or you could use the form Next() method) should still work

>Anyway, the table has another field, called OldValue. In OldValue I save the current record lName. IOW, replace command does replace lName with NULL, OldValue with lcLName. Still I'm not sure, how this value will help me. I can set Near on, do seek on this value, so it automatically moves to another record. But I should not use thisform.Next() then, right?

I think something like this would work:

In whatever method the double-click fires:
ThisForm.iCurrentRec = recno()
{exec new record code}
GOTO ThisForm.iCurrentRec
ThisForm.Next()
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform