Page Index Toggle Pages: 1 [2]  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) Subform item selection (Read 3816 times)
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: Subform item selection
Reply #15 - May 24th, 2011 at 4:57pm
Print Post Print Post  
Quote:
Sorry, no sample, I have Sesame 3 work a-plenty. But, there is no need to use ClientLocalValue unless you want to pass the variable around from form to form, and even then I'd recommend that you only use the ClientLocalValue after the string is complete. A simple string, array, or string array will do the trick.


Ok, so the string array could be stored in an unbound text field on the main form, but how do you know which row "ID" in the subform is being selected? And how would that information get back to the main form?

Quote:
When the user clicks in the row (maybe in a field for that purpose),


What command can indicate that a subform record has been selected? Or is the subform's programming indicating it in some way?
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Subform item selection
Reply #16 - May 24th, 2011 at 5:15pm
Print Post Print Post  
Acebanner wrote on May 24th, 2011 at 4:57pm:
Quote:
Sorry, no sample, I have Sesame 3 work a-plenty. But, there is no need to use ClientLocalValue unless you want to pass the variable around from form to form, and even then I'd recommend that you only use the ClientLocalValue after the string is complete. A simple string, array, or string array will do the trick.


Ok, so the string array could be stored in an unbound text field on the main form, but how do you know which row "ID" in the subform is being selected? And how would that information get back to the main form?


You can, if you wish store the string array, but it isn't necessary. The row would be identified in the code called when the user enters the row to select it. That "row" would be able to obtain its own ID or record number, and any subsequent code could use FormFieldValue or FormResultSet commands to get the corresponding info - if not run from that form.

Quote:
Quote:
When the user clicks in the row (maybe in a field for that purpose),


What command can indicate that a subform record has been selected? Or is the subform's programming indicating it in some way?


That code would run as part of the programming for that form, so selection is merely entering (clicking on) a specific field.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
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: Subform item selection
Reply #17 - May 24th, 2011 at 8:44pm
Print Post Print Post  
Hello,

If you wish to store the value with each record the code below should work for you

Code
Select All
Var vEvent as String

vEvent = @EventState()

If (@AccessStringArray(vEvent, 8) = 1) or (@AccessStringArray(vEvent, 1) = 2) Then
{
	If Print = @Chr(82) Then
	{
		Print = @Chr(163)
	}
	Else
	{
		Print = @Chr(82)
	}
	ForceRedraw()
}
Throwfocus(City) 



To recreate the file I used to work with this code follow the steps below
Open Sesame Designer
Open Countries.db
Go in to redesign the Cities form
Add an Unbound Text box at the top of the Form
Make that Text box Read Only and set it's width to 1
Below that but above City, Add a Text box bound to a New Text Field named Print
Set the label of the Print element to be 'P', without the quotes
Set both the Label and Text font of Print to be Wingdings 2
Set the Print element to be Read Only
Place the code above in the On Element Enter event of the Print Element
Save and Preview

-Ray
  

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


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Subform item selection
Reply #18 - May 24th, 2011 at 10:15pm
Print Post Print Post  
Thanks Ray. You always come up with some incredible solutions! Your explanation is thorough. Never looked into @EventState ( ) before. Very interesting!! Thanks again.
  
Back to top
 
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: Subform item selection
Reply #19 - May 24th, 2011 at 10:57pm
Print Post Print Post  
I agree, that is outstanding and very clever!

Thanks  Ray!
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Subform item selection
Reply #20 - May 25th, 2011 at 2:33am
Print Post Print Post  
Wow! Ray doesn't mess around.  Wink
  
Back to top
IP Logged
 
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: Subform item selection
Reply #21 - May 25th, 2011 at 1:05pm
Print Post Print Post  
Great solution -- now I have to take a better look at @EventState command.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send Topic Send Topic Print Print