Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating Forms
Message
De
02/04/1999 11:33:56
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
02/04/1999 11:09:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00204658
Message ID:
00204669
Vues:
13
>Hello -
>
>I had a hard time thinking of a title to give this question. I really don't know what to call it.
>
>I have a form called Offices, and on that form I have a cmd button called "Assign Contact". When I fire that cmd button, my "Office Assignments" form pops up.
>
>The problem is, the officeid of the Offices Form is not appearing in the OfficeId textbox of the Office Assignments Form when it pops up.
>
>My desire here is to scroll through my offices form and click on my assign contacts button and assign contacts for that specific office. As it stands now, I am just assigning contacts to nothing!
>
>How can I have my assign contacts form pop up with the officeid number of the current record I am on in my offices table in the office assignments form, reflecting only the contacts of the specific office.
>
>
>BACKGROUND: My offices table is relatd to my office assingments table as a one-to-many relationship, joined by nofficeid.
>
>
>
>Any thoughts would truly be appreciated. This is vital to learn b/c I have a lot of other forms I need to accomplish the same task with.
>
>
>TIA for any comments/help
>
>Jason
Jason,
Called form might not be using default datasession and/or has something like Autoopentables=.t. in DE.
Anyway I would suggest called form have private datasession and pass the id to it. Then init of form would look like :
lparameters tcOfficeId
=seek(tcOfficeId,"mytable","myOfficeIdTag")
* Child table would automatically limit the contacts to specific OfficeId
* Or if this is a RO form then you could :
* select * from myOffice, myContacts ;
   where myOffice.OfficeId = myContacts.OfficeId ;
       and myOffice.OfficeId = tcOfficeId ;
       into cursor myThisFormCursor
* and use myThisFormCursor for thisform
* if you need only one parameter passed back then
* you could make thisform modal and in unload return the whatever value you want
* Caller would call like : do form myAssignment with SomeId to BackValue
* Or a smarter way :
* Caller would call like : do form myAssignment with SomeId, this
* Passing itself to called form makes called form capable of using caller's PEM
* Shorter : do form myAssignment with this  && Because now called form could
*                                              access any PEM of caller
* Now new init of called :
lparameters toCaller
this.oCaller = toCaller   && Save to a custom form property
=seek(toCaller.myOfficeIdtxtbox.value,"mytable","myOfficeIdTag")

* Some button's click event code - Some change in caller
thisform.oCaller.mySomeTxtbox.value = ;
      thisform.anothertxtbox.value   && Change some value in caller
* If it has programmaticchange event code see fancy result
thisform.oCaller.refresh() && and refresh the caller :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform