Normal Topic Switch Between Databses in Same Application (Read 438 times)
JimboP
Member
*
Offline



Posts: 3
Location: Oakville ON
Joined: Jul 28th, 2007
Switch Between Databses in Same Application
Jun 16th, 2010 at 5:46pm
Print Post Print Post  
I am having trouble getting this little button program to work.
I want to switch between two databases with a parent child relationship and a common Account Number in the same application.
In this case I want to switch from the Child DB to the Parent DB with the same Account number.
               Child db "YZ"  form Name "SBEYZ"   Should I include Application Name?
               Parent  db "Members"  form Name "SBE Data" 



var vTemp as Integer
var vActNo as String


{
FormCommit("")
vActNo = @FormFieldValue("YZ!SBEYZ","MembersAccount",1)               //Pick up Account No in Variable  vActNo
                               

vTemp = @SelectTreeItem(@Application + "!Forms!Search/Update!Members!SBE Data")  // Go to Search mode in Parent db

FormFieldValue("Members!SBE Data","AccountNo",1,vActNo)                 //  Place Account number in "AccountNo" Field
                                                                                                                                    

vTemp=@SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)")  // Retrieve record

throwfocus(Tag)
}

Help would be appreciated

Jim P
  
Back to top
 
IP Logged
 
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: Switch Between Databses in Same Application
Reply #1 - Jun 16th, 2010 at 6:07pm
Print Post Print Post  
You might want to look into XResultSetOpenForm command. You would just find the relevant parent record as an XResultSet, and then use that command.
  
Back to top
IP Logged