Normal Topic external posting to subform (Read 473 times)
debmckee
Full Member
***
Offline



Posts: 123
Joined: Oct 5th, 2011
external posting to subform
Dec 13th, 2011 at 6:12pm
Print Post Print Post  
Is there an "easy" way to make post from the parent form to the subform.  IE;  set a value on the subform from a field on the parent form.   Sort of  a "subform field" = "parent field" from the parent form.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: external posting to subform
Reply #1 - Dec 13th, 2011 at 6:49pm
Print Post Print Post  
SBasic command - FormFieldValue()
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: external posting to subform
Reply #2 - Dec 14th, 2011 at 4:42am
Print Post Print Post  
in context of a parent form with a subform that has multiple records, here's a loop from parent to the subform records:

// this syncs the SOLines!SODate and SOLines!SONum
// with Orders!SODate and Orders!SONum
// in case the SODate is moved into the future during
// the building process, or SONum is inadvertently changed
// during the middle of the building process

          vCnt1 = @FormResultSetTotal("SOLines")

          vLoop1 = 1
          While vLoop1 <= vCnt1

                {
                     FormFieldValue("SOLines", "SODate", vLoop1, vSODate)                  
                   FormFieldValue("SOLines", "SONum", vLoop1, vSONum)                  
                   FormFieldValue("SOLines", "ClientID", vLoop1, vClientID)            
                   FormFieldValue("SOLines", "ShipToID", vLoop1, vShipToID)            
                   FormFieldValue("SOLines", "ShipToClientID", vLoop1, vShipToClientID)      
                   FormFieldValue("SOLines", "ClientName", vLoop1, vShipToName)
                   If vDNI = "Y"
                     {
                         vDNIinv = "E"
                         FormFieldValue("SOLines", "Invd", vLoop1, vDNIinv)
                         FormFieldValue("SOLines", "BO", vLoop1, vDNIinv)
                     }

                             
                      vLoop1 += 1
               }
  

Larry
Back to top
IP Logged