Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does record pointer past EOF()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00064257
Message ID:
00064274
Vues:
35
Vlad,

Thisform.disabledata() is a method used to disable a number of controls on the form.

I got it to work with the following code:

*method deleterecord

local cthisrec, cname1 cname2, ctext1, ctext2
cthisrec = recno()
cname1 = alltrim(sysusers.emp_first)
cname2 = alltrim(sysusers.emp_last)
ctext1 = "Are you sure you want to delete "+cname1+" "+cname2+" ?"
ctext2 = cname1+" "+cname2+" has been successfully deleted !"

if messagebox(ctext1,4+32+256,"** Confirm User Deletion **")=6
select sysusers
delete
skip
cthisrec = recno()
if eof()
go bottom
cthisrec = recno()
endif
=messagebox(ctext2,64,oSys.appname)
endif

thisform.disabledata()
thisform.refresh() && after this refresh, the record pointer moves past EOF()
go cthisrec
thisform.refresh() && after this refresh, the record pointer is at 'cthisrec'
thisform.cboFirstName.refresh()

I have no idea why the first thisform.refresh() causes the record pointer to go past the end of the table.

AL


>What is ThisForm.DisableData ?
>
>Vlad
>
>>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?
Al Williams

Anola MB, CANADA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform