Normal Topic mass update (Read 557 times)
debmckee
Full Member
***
Offline



Posts: 123
Joined: Oct 5th, 2011
mass update
May 11th, 2012 at 5:33pm
Print Post Print Post  
I have created a new field in a subrecord that is using @formfield value to get info from the parent record.  Is there an easy way to update my existing records with this programming statement?
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: mass update
Reply #1 - May 11th, 2012 at 6:17pm
Print Post Print Post  
Yes. Push the data to the subrecords, rather than pulling it from the parent.

In other words, run the mass update on the parent, and loop through the subrecords from the parent's code.

You might use something like this:
Code
Select All
var vCnt as Int
var i as Int

vCnt = @FormResultSetTotal("[SubformNameHere]")
For i = 1 to vCnt
	FormFieldValue("[SubformNameHere]", "Name", i, Name)
	FormFieldValue("[SubformNameHere]", "Category", i, Category)
	FormFieldValue("[SubformNameHere]", "Amount", i, Amount)
	FormFieldValue("[SubformNameHere]", "Note", i, Note)
	FormFieldValue("[SubformNameHere]", "Check No", i, Check No)
Next
 

  


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



Posts: 123
Joined: Oct 5th, 2011
Re: mass update
Reply #2 - May 11th, 2012 at 7:29pm
Print Post Print Post  
Thank you!

Worked like a charm.
  
Back to top
 
IP Logged