Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does record pointer past EOF()
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00064257
Message ID:
00064305
Views:
36
>>I have a form with the following code for deleting a record:
>>
>>if messagebox("Are you sure you want to delete this user ?",4+32+256,"** Confirm User Deletion **")=6
>> select sysusers
>> zrecord = recno()
>> delete
>> zrecord1 = recno()
>> skip
>> zrecord2 = recno()
>> if eof()
>> go bottom
>> endif
>>endif
>>
>>thisform.disabledata()
>>zrecord3 = recno()
>>thisform.refresh()
>>zrecord4 = recno()
>>
>>save to zzz all like z*
>>
>>When I delete record 3 (in a table of 22 records), the values of the memory variables I created to determine the current record are as follows:
>>
>>zrecord: 3 - this is correct
>>zrecord1: 3 - this is correct
>>zrecord2: 5 - this is correct
>>zrecord3: 5 - this is correct
>>zrecord4: 23 ??? (the last record is 22)
>>
>>There is no code the refresh method of the form.
>>
>>Why is the value of zrecord 23?
>
>Allan, seems to me that you're looking at a different table for zRecord4. You can be sure by using zRecordN = recno('mytable'), or by storing the active alias. Probably your form refresh switches active tables. Remember that the form refresh automatically calls the refresh method of the various controls. One of these (a combo box, maybe) calls a different table.
>
>HTH
>Barbara

Seeing that he has 22 records and zRecord4 is 23, it's almost sure that the table is correct. But you're probably right that it must be a control Refresh method that moves the rec pointer.

BTW, did you ever have a case when DELETE with no clauses changed the rec pointer?

Vlad
Previous
Reply
Map
View

Click here to load this message in the networking platform