Normal Topic Search By Last Name Command Button (Read 1000 times)
jyellis
Full Member
Members
***
Offline


No personal text

Posts: 114
Location: Dallas-Fort Worth Area
Joined: May 19th, 2003
Search By Last Name Command Button
Jun 3rd, 2006 at 5:21pm
Print Post Print Post  
Please help.  I know this should be simple.  I have a command button "Search by Last Name" that will only be visible in update mode.

If last name is "", then prompt user for last name or first few letters (For Example, user clicks Command button enters St; through code it retrieves the records for Steven, Stork, etc.
  
Back to top
 
IP Logged
 
jyellis
Full Member
Members
***
Offline


No personal text

Posts: 114
Location: Dallas-Fort Worth Area
Joined: May 19th, 2003
Re: Search By Last Name Command Button
Reply #1 - Jun 4th, 2006 at 10:42pm
Print Post Print Post  
I changed my mind...

On form called “Fitness”; I want the user to click on a command button that will display Last Name; First Name; Key Number from a form call Profile in the same db.

After they select the correct name; populate the same fields (Last Name, First Name; Key Number) on this form (Fitness)



  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Search By Last Name Command Button
Reply #2 - Jun 4th, 2006 at 11:19pm
Print Post Print Post  
Have you looked into @SelectTreeItem and "on retrieve spec" programming?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
jyellis
Full Member
Members
***
Offline


No personal text

Posts: 114
Location: Dallas-Fort Worth Area
Joined: May 19th, 2003
Re: Search By Last Name Command Button
Reply #3 - Jun 4th, 2006 at 11:25pm
Print Post Print Post  
Quote:
Have you looked into @SelectTreeItem and "on retrieve spec" programming?


No, because I thought I needed to look at the @xlookupsourceListAll to create a multi column picklist.

I haven't gotten past this...using an example from pg 92 of the book.  It returns nothing. 

(On element entry of command button)

var MyStr as String
     
MyStr = @XLookupSourceListAll(@FN, "..", "Profile!LNAME", "LNAME;First Name;Key Number5")

WriteLN(MyStr)
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Search By Last Name Command Button
Reply #4 - Jun 4th, 2006 at 11:34pm
Print Post Print Post  
@XLookupSourceListAll will return all of the values for all of the LEs specified for all of the matching records. If you are trying to populate one record of retrieve spec, you might want @XlookupSourceList instead. It will return the values for each of the specified LEs for the first matching record.

To make either work, first simplify. Try just one LE name at a time and get it working until you find the one that isn't correct. Double and triple check the names.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
jyellis
Full Member
Members
***
Offline


No personal text

Posts: 114
Location: Dallas-Fort Worth Area
Joined: May 19th, 2003
Re: Search By Last Name Command Button
Reply #5 - Jun 5th, 2006 at 12:39am
Print Post Print Post  
I wish I could work with Sesame all the time.  Only doing this once in a blue moon makes it hard to retain.  Plus I get confused with Access/Excel Programming.

Anyway...THANK YOU....Thanks to your guidance I got the picklist to popup from command button; now I'll need to figure out how to populate this form with their choice.  But my first attempt below populates the each form elements with the first 3 records (Last Name * First Name * Key Number5 in each field) not parsed out.  So how do I parse the field back out.

Code
Select All
var MyStr as String
var VLName as String

    
MyStr = @XLookupSourceListall(@fn, "..", "Profile!Last Name", "Last Name;First  Name;Key Number5")

MyStr = @replace(MyStr, ";", " " + @chr(149) + " ")

MyStr = @replace(MyStr, @Chr(10), ";")

vLName = @PopupMenu(MyStr,"Select one of these Employees")

Last Name = @AccessStringArray(myStr, 1)
First  Name = @AccessStringArray(myStr, 2)
Key Number5 = @AccessStringArray(myStr, 3)
 

  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Search By Last Name Command Button
Reply #6 - Jun 5th, 2006 at 12:48am
Print Post Print Post  
You probably want to set "Last Name", "First Name", and "Key Number5" from the parsed values returned from @PopupMenu ("vLName") using @AccessStringArray. You will probably want to replace the string separator in "vLName" again, before doing so.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
jyellis
Full Member
Members
***
Offline


No personal text

Posts: 114
Location: Dallas-Fort Worth Area
Joined: May 19th, 2003
Re: Search By Last Name Command Button
Reply #7 - Jun 5th, 2006 at 12:48am
Print Post Print Post  
FOUND IT:

MyStr = @Replace(MyStr, " " + @chr(149) + " ", ";")

yes!!!!
  
Back to top
 
IP Logged