Normal Topic Open to a specific record within a file. (Read 2034 times)
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Open to a specific record within a file.
Feb 6th, 2019 at 9:59pm
Print Post Print Post  
I'm trying to open a second file within my data base while working in a file.  I can open the second file OK using

vMenu = @SelectTreeItem(@Application + "!Forms!Search/Update!NEWPROCS!WORK INSTRUCTIONS")

with a command button.  When the second file opens it is at the Retrieve Spec.  I'd like to bypass the need to enter the Retrieve Spec and go directly to the second file based on the entry in an element in the first file.

Is that possible?

Any help would be appreciated.

NH User
  
Back to top
 
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Open to a specific record within a file.
Reply #1 - Feb 6th, 2019 at 10:06pm
Print Post Print Post  
I just realized the command I show in my prior post opens the file in the Retrieve Spec, if the file was unopened.

If the file is open to a record when I invoke the programming, the second file merely opens at whatever file is current.

I'd still like to force it to go to a specific record, if possible.

NH User
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2483
Joined: Aug 20th, 2003
Re: Open to a specific record within a file.
Reply #2 - Feb 7th, 2019 at 3:27pm
Print Post Print Post  
Hi Paul,

As long as you are on 2.6.4, an earlier version had an issue with this, you can do this with XResultSetOpenForm(). The example below opens the Customers form to the record that has the ID of 1000.

Code
Select All
Var vRS as Int

vRS = @XResultSetSearch(@FN, "Customers", 0, 2, "!Key=1000")
If vRS >= 0 Then
{
	If @XResultSetTotal(vRS) > 0 Then
	{
		XResultSetOpenForm(vRS, "Customers")
	}
	XResultSetClose(vRS)
} 



-Ray
  

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