Normal Topic Show Only Some Data in Sub Form. (Read 847 times)
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Show Only Some Data in Sub Form.
Jan 13th, 2010 at 9:40am
Print Post Print Post  
I have a sub form, which is pay information, which is entered via a parent form, I am wanting to show all of the past pay for the emplyee that is being entered, I have a commen key which is the employee's name, how am I able to sort and show the data only beloning to that emplyee in the sub form.
  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Show Only Some Data in Sub Form.
Reply #1 - Jan 13th, 2010 at 12:55pm
Print Post Print Post  
You need to match the "Parent Record Field" and "Child Record Field" in the Subform Settings dialogue box within Designer.

(I've got to catch a flight in a few hours, so I may not respond for a day or so, if you have any follow-up questions.)
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: Show Only Some Data in Sub Form.
Reply #2 - Jan 13th, 2010 at 11:49pm
Print Post Print Post  
Done this however now I am unable to save data to the subfrom from the parent form, using the following code

var vSub as String
var vRec as Int

     vSub = "Pay History"
     vRec = @FormNewRecord(vSub)       // Create the new subrecord

     FormFieldValue(vSub, "le2", vRec, le1)
     FormFieldValue(vSub, "Ord Hrs", vRec, Hours)
//      FormFieldValue(vSub, "Alpha Key", vRec, Employee)
//      FormFieldValue(vSub, "Ord Hrs", vRec, Hours)
//      FormFieldValue(vSub, "Ord Hrs", vRec, Hours)
//      FormFieldValue(vSub, "Ord Hrs", vRec, Hours)
//      FormFieldValue(vSub, "Ord Hrs", vRec, Hours)
//      FormFieldValue(vSub, "Ord Hrs", vRec, Hours)

     FormCommit(vSub)       // Save the new subrecord
     FormCommit("")             // Save the parent record
     If @FormViewType(vSub) = 0
     {
           FormResultSetCurrentPosition(vSub, vRec)
     }
  
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: Show Only Some Data in Sub Form.
Reply #3 - Jan 14th, 2010 at 2:06am
Print Post Print Post  
All good i have sorted it out, the data was being saved, how ever the child key was not updateing, to show the records in the subform, fixed it now works.
  
Back to top
IP Logged