Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding records in a form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00172963
Message ID:
00172980
Vues:
16
>select bsloc
>append blank
>
>If I check the record number here it is -1 as it should be.
>
>When the data appears in the form it is setting on record #4.

Not sure I'm clear when "the data appears in the form," but here's my guess: in your setup code, are you pulling data from other records to be used in the record you're appending, and not returning the record pointer to the one you're appending?

Suggested solutions if that's what's going on:
1) "USE bsloc AGAIN IN 0 ALIAS dummy" to get the data you need from the other records, rather than moving the record pointer in the "live" table.
2) Before you move the record pointer in the live table to pull some data from another live record into the one you're appending, save the record pointer's position (-1, or -X if you can append more than one) to a memvar. After getting the data from the live record, GOTO the appending record:

oldrecpos = RECNO()
SEEK(other record) && or LOCATE or whatever you do
SCATTER FIELDS from other record MEMVAR && or whatever
GOTO m.oldrecpos
GATHER MEMVAR && or whatever

(If that's not EXACTLY what's going on, I suspect it's still some event code firing at some point between the APPEND and "the data appears in the form" which moves the record pointer. You need to find what event it's in and use one of the above methods to correct it. Either move the record pointer in a USE AGAIN copy of the table instead of the live table, or save the record pointer and restore it.)

HTH
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform