Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing a record from one form to another
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00037608
Message ID:
00037767
Vues:
33
> >Store the parameter in a form property and then, after all of the Inits > >of the object, say in the Init of the Form, go back to the right > >record. If that doesn't work you might want to introduce a wait of, > >say, .5 seconds. I've used INKEY() to do this and it works fairly well. > > > >/Paul > > I just made some progress. To back up a bit, my form2.Init has a LOCATE > FOR keyfield = param, followed by a call to my .NavRefresh method. There > was nothing after this in my .Init. It turns out that if I put some sort > of delay in form1.grid.columnX.text1.click right before the DO FORM form2 > WITH keyfield, it works correctly. Aha, I thought. Maybe at that moment > it hasn't yet moved the record pointer to the record for the row on which > you clicked. No, that wasn't it. I substituted "keyfield" with a hard > coded number, and the result was the same. If I put a delay before the DO > FORM, either with INKEY or WAIT WINDOW, the correct record was displayed in > form2. Otherwise, it would show the first record. If I can't find any > better solution, I'll just use INKEY(.5), but I don't like it. First of > all, I don't like delaying the loading of the most commonly used form in > the app. Second, I don't trust time delays. How do I know that .5 seconds > will be long enough on every system? Third, the whole situation seems > absurd. There must be a better way. Is there something fundamentally > wrong with the way I'm passing a parameter from an object.click in one form > to another? Don't forget that the time delay was the second option. The first was to re-locate the record after everything else was finished. I agree that it seems hokey, but it's the only solution that I've found so far. /Paul
Paul Russell
EMail: prussell@fox.nstn.ca
Phone: (902) 499-5043
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform