Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use menu as main form...read events..calling forms from
Message
 
À
27/04/2000 00:30:31
Tom Gahagan
Alliance Computer Solutions
Thomaston, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00363788
Message ID:
00364285
Vues:
16
You're raising more than one issue here, but they may be related.

First, is there any reason why you want to use SCATTER/GATHER instead of binding the controls on the form directly to the fields in the cursor? What do you have set as ControSource for the controls? If you're using SCATTER/GATHER, you have to use the memvars as the ControlSources. The answers to these questions explain why the data isn't saved.

I still say there may be something in the form's Load or Init that's causing it to close immediately the first time you call it. Could you post the code you have in the form's Load and Init methods? That might provide a clue, although it's pretty strange that the form works fine in a separate PRG. Are you using the BT variable in that program too?

One other technique you might want to try:
Instead of having the menu perform a procedure as its result, have it run a command instead, and make that command the DO FORM... line. If you don't want the menu to be available when the form is up (which I'm assuming is what you want, since you're setting SYSMENU OFF in the procedure), just make the form's WindowType property Modal instead.


>Barbra....
>
>Thanks for your reply!
>
>
>I noticed the books you are talking about and will try and find them locally in Atlanta. I've have stayed away from the OOP book because of the "Advanced title".
>
>As for the code....
>
>When the menu item that calles the proc (see below) that calls the form is clicked the following would happen:
>
> The form will appear with no cursor etc then instanly appear again with the cursor on the field that I set focus too. You can enter data etc but the data was not being saved and the name of the screen was not being recognized in the clik event where I had placed ..... object.relese code... it would crash with an object not found error.
>
>here is the code.....
>
>procedure patmain
>*
>*
>
>push menu _msysmenu
>set sysmenu off
>public bt
>bt = .f.
>use patient in 2
>
>do form patient
>
>*** the form ok command button sets bt to .t. and releases the form
>*** the form cancel button set bt to .f. and releases the form
>*** scatter memvar is in the load event
>*** I did the thing with bt because I thought the code I had put in the form *** was not working correctly... I put the gather memvar in the click event of *** the ok command button. So I tried something else. At that time I did not *** realize that the form was showing and immediatly going on.
>
>** this is wher I inserted the wait command
>
>if bt = .t.
>
>*** I also put one here to see if this code was working... it never go to this *** point.
> select 2
> gather memvar
>endif
>
>use
>select 1
>pop menu _msysmenu
>set sysmenu automatic
>return
>*
>*
>
>When I realized the data was not being saved i put a wait command right after the do form line.... that is how I realized that the form was being called... did not stop and went immediatly to the wait command. The data was not being saved because somehow it was only after you leave the wait state that the form comes up again... this time with the cursor.... but the table had been closed from the last few lines of the procedure.
>
>Why?
>
>I put the form in a seperate test prg that had it own read events code (not called from a menu) and it worked fine.
>
>I'm building the app to provide Diabetics a program to keep track of their blood sugar test results and the types of meds and the times they take them so they can provide their doctors with printed info and/or info on disk... and If I can get on with my "RE" learning Foxpro perhaps even send their docs the info over the net? My plans are to sell the program to Doctors for a small fee and let them give it to their patients for free.
>
>Any help getting me over this hump will be appreciatted!!!!
>
>Tom
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform