Normal Topic Form view subform question (Read 610 times)
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Form view subform question
May 27th, 2011 at 6:38pm
Print Post Print Post  
From a parent record I’m able to use @XResultSetSearch and @PopupChoiceList to view the records in a Form view subform.  Is there a command, that when a selection is made from the list, that it will bring into view, the subform record selected?

Thank you.
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Form view subform question
Reply #1 - May 27th, 2011 at 8:25pm
Print Post Print Post  
Hello,

Since you have the records already loaded in the subform you can just use @FormGetValues() and @PopupChoiceList. You can then use @FindStringArray() and FormResultSetCurrentPosition() to move to that record. This is assuming you have a unique key field in each subrecord.

Example using sample gems database with unique Gem names in each subrecord
Code
Select All
Var vGems as String
Var vPickedGem as String
Var vPos as Int

vGems = @FormGetValues("Gems", "Gem")
vPickedGem = @PopupChoiceList(vGems, "Pick a Gem")
If vPickedGem <> "" Then
{
	vPos = @FindStringArray(vGems, vPickedGem)
	FormResultSetCurrentPosition("Gems", vPos)
} 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: Form view subform question
Reply #2 - May 28th, 2011 at 12:11am
Print Post Print Post  
Very nice Ray,

Thank you so much for the help!

Brandon
  
Back to top
IP Logged