Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding more than one record to child form
Message
 
À
24/05/1999 19:23:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00222267
Message ID:
00222287
Vues:
14
Jason,
A couple of items come to mind.

1. How are your parent and child tables linked? If by a relation then this may be your problem. It sounds as if the fielddetail form is forcing a return to the first record after adding the second. Walk through the ADD code with the debugger to see where record # changes from the new (just added) record to record one.

2. Are your two forms sharing a datasession? If the VotersFile form has a private DS is your FieldDetail form set to Modal and Default DS so it shares a datasession with the VotersFile form? Or are both the forms using the Default DS? This could make a difference.

3. If neither of these ideas seems to help, please post the code in your ADD button. Maybe that will help.

Barbara


>Hi -
>
>I am having a "fair" amount of problems with two new tables and forms I created. I have received help on this issue from several developers over the past 24 hours, but I still have not got it to work. I am going to try to post a more detailed post and do a better job of explaining my situation, and maybe someone will be able to shed some light on my particular problem.
>
>Situation:
>
>I have a parent form (votersfile) and a child form (fielddetail). My votersfile table is keeping track of various fields used to tell us which voters to pull for a specific office:
>
>Example:
>Record 1
>Label = Congress
>Code = Cong_dist
>
>Record 2
>Label = State Senate
>Code = St_up_hous
>
>When I fire my child form, the "code" automatically appears in my child form. Example: If I was on record one and clicked my cmd button "assign", Cong_dist would pop up in my nfieldid combo box on my child form, just the way I want.
>
>So far, so good!
>
>the child form is assigning "options" to the "code":
>
>Example:
>
>Record 1 :
>Fieldid = Cong_dist
>option = 001
>label = Broward
>
>Record 2
>Fieldid = Cong_dist
>option = 002
>label = Miami-Dade
>
>*** I can assign the first one, however, when I click "add" and go to assign another option I have problems.
>
>As soon as my cursor touches my option textbox, FoxPro places the previous value I typed. In this example, if I was to go and type 002 in the second record, FoxPro will place 001 in the second record as soon as the cursor touches it!
>
>Now, I can delete the text and type in 002 in the option field, but it only will change the 001 to 002 in the first record, leaving record number two blank in the option field.
>
>If I go back to my table and look at what is stored, I can see the first record, and the second record just shows the autokey number and ID # for Cong_dist, but the option and label field is blank.
>
>Very wierd! There are two autokey numbers being generated, but only the first record is allowing any values in the option and label textbox.
>
>
>_____________________________________________________________________
>
>Background information:
>
>I have code placed in the init() of my child form:
>
>lparameters tnvoterId
>=seek(tnvoterId,"votersfilefields","nfieldid")
>=seek(tnvoterId,"fielddetails","nfieldid")
>set key to votersfilefields.nfieldid in fielddetails
>
>
>The code in the click() of my cmd button on my parent form is:
>
>do form fielddetails with voterfilefields.nfieldid
>
>
>That's about it...
>
>TIA for any comments to this problem
>
>Jason
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform