Very Hot Topic (More than 25 Replies) Selection box (Read 7089 times)
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Selection box
Jan 26th, 2004 at 8:02pm
Print Post Print Post  
My database is named Myfirst.db
I have 2 databases in Myfirst.db 1 called Purchase and 1 called vendors
The forms are named Purchase and Vendors
The database vendors has a field called Vendorname that has all of the vendors names in it.

I would like to have a selection list built from that data called from the purchase database.

What is the recommended method?  Xuserselect or @popupmenu or ?
  
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: Selection box
Reply #1 - Jan 26th, 2004 at 8:51pm
Print Post Print Post  
@PopUpMenu with @xListvalues gives you the list you need and xuserselect command will do the same. However, if your vendor list is very long, I personally like the @xuserselectr which can narrow down the list. Ofcourse it requires a little coding but works great to narrow down your choice.

If you place Bl.. entry in the element, it will give you list of every vendor begins with "Bl  " only.

The topic was discussed in the following link....

http://www.lantica.com/Forum2/cgi-bin/yabb/YaBB.pl?board=gen_disc;action=display...
  
Back to top
 
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #2 - Jan 26th, 2004 at 9:16pm
Print Post Print Post  
Quote:


Were are you using XUserselectR  in this ? can you please dumb this down a little for me. This is a big bite I am trying to take. I am new to this.

vStart as string
vFieldName as string
vEnd as string 


If @in (vFieldName, "..")  > 0 then

    vStart = @left (vFieldName, @in (vFieldName, "..") - 1) + @chr(1)
    vEnd = @left (vFieldName,   @in (vFieldName, "..") - 1) + "zzzzzzz"
}
  
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: Selection box
Reply #3 - Jan 26th, 2004 at 9:24pm
Print Post Print Post  
I will place the whole code, but for better understanding first read the Programming Manual Page 133 and Page 134.  The text you quoted deals only with "start" and "end" part of the xuserselectr command.
  
Back to top
 
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #4 - Jan 26th, 2004 at 10:03pm
Print Post Print Post  
I thought I would simplify this try with set start and end. But I still have got it wrong.

My database is named Myfirst.db
I have 2 databases in Myfirst.db 1 called Purchase and 1 called vendors
The forms are named Purchase and Vendors
The database vendors has a field called Vendorname that has all of the vendors names in it.
The database purchase has a field called purchasefrom

   XUserselectr(
My filename C:\Sesame\Data\myfirst.db,
My ext selection element  vendors!vendors
Source element vendorname
Start A
End  Z
Target Purchase from

The final statement reads

   XUserselectr(“C:\Sesame\Data\myfirst.db”, “vendors!vendors”, “vendorname”, “A”,” Z”, “ Purchasefrom”)
  
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: Selection box
Reply #5 - Jan 26th, 2004 at 10:15pm
Print Post Print Post  
The following code goes in Global Code

stat vFieldName as String
stat vStart as String
stat vEnd as String

Subroutine PickList_choose( )

vStart = @left (vFieldName, @in (vFieldName, "..") - 1) + @chr (1)
vEnd = @left (vFieldName,   @in (vFieldName, "..") - 1) + "zzzzzzz"
End Subroutine

Place this in your VendorName Element on element exit event.  I have adjusted it to the name of your element and database name.

if @in(VendorName, "..") > 0 then

     {
           vFieldName = VendorName
           picklist_choose ( )
           
           VendorName = @xUserselectR (@filename, "Vendors!VendorName", "VendorName", vStart, vEnd)

     }



  If the form name is not exactly matching or the element name is not matching, you might have to change it.  Please let me know if this works.  If you need to have Names of all vendors just place ".." in the field.
  
Back to top
 
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #6 - Jan 26th, 2004 at 11:09pm
Print Post Print Post  
Thank you for your kindness in helping.

The database takes the code without error upon test. But nothing happens when exiting field.

Could I impose on you farther and ask if  you possibly can annotate your programming step by step as to what is happening so I can follow along closer

Thank you
  
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: Selection box
Reply #7 - Jan 26th, 2004 at 11:27pm
Print Post Print Post  
I believe you are trying to test the code in the preview mode of Sdesigner.  It would not work there as x-family commands and functions would not work in preview. You want to reconcile with database and then test it.

Please let me know if it works or still does not work that way.
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Selection box
Reply #8 - Jan 26th, 2004 at 11:40pm
Print Post Print Post  
Bill,
how about backing up for a moment and just use a simple XUserselectR  Syntax without anything fancy just to be sure you are accessing the external database.

For the purpose of  clarification  see if your syntax matches the books explanation as Bharat pointed out on pages 133 and 134.

I know sometimes the manual gets overwhelming so I have tried below in plain speak to explain what  I believe the Syntax of the basic XUserselectR is:

Filename = the full path of db file

FormName!ext selection element = form name plus ! sign and the name of the element from the external database that you want to display data from.


Source element = the field from the external database that will be returned when the above is selected.

Start = starting range

End = ending range

Target element = the element the data will be put in.


(Bharat,

This makes me think if the target  is on a subform does the subform name or main form name need to be added?)

Once you have your XUserselectR working with just the start and end stated as in the example on pg 134 , We can then get fancier and follow Bharats lead.

Keep plugging away at it, You will eventually get it working.

Robert
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #9 - Jan 26th, 2004 at 11:45pm
Print Post Print Post  
Quote:
I believe you are trying to test the code in the preview mode of Sdesigner.  It would not work there as x-family commands and functions would not work in preview. You want to reconcile with database and then test it.

Please let me know if it works or still does not work that way.


No I am not using preview. I am using a reconciled version.
  
Back to top
 
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #10 - Jan 27th, 2004 at 12:08am
Print Post Print Post  
Bob I really like the simple way you explained the command thank you. Your simple English is easier for me to understand then the manual. However  I am sorry to say it still does not work for me.
  
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: Selection box
Reply #11 - Jan 27th, 2004 at 12:57am
Print Post Print Post  
The following code goes in Global Code  

stat vFieldName as String
stat vStart as String
stat vEnd as String

Subroutine PickList_choose( )

vStart = @left (vFieldName, @in (vFieldName, "..") - 1) + @chr (1)
vEnd = @left (vFieldName,   @in (vFieldName, "..") - 1) + "zzzzzzz"
End Subroutine

Place this in your PurchaseFrom Element on element exit event of PurchaseFrom element.  I have adjusted it to the name of your element and database name.

if @in(VendorName, "..") > 0 then  

{
 vFieldName = PurchaseFrom
 picklist_choose ( )
 
 PurchaseFrom = @xUserselectR (@filename, "Vendors!VendorName", "VendorName", vStart, vEnd)

}

Bill, after reading your database specification that I did not read earlier, I had to make changes at two places. I think your earlier posting and my post got crossed, so did not get to read your note. I think this should work. If it does not, I will work with you till it does.


  
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: Selection box
Reply #12 - Jan 27th, 2004 at 1:04am
Print Post Print Post  
Quote:
Bharat, 

This makes me think if the target  is on a subform does the subform name or main form name need to be added?)

Once you have your XUserselectR working with just the start and end stated as in the example on pg 134 , We can then get fancier and follow Bharats lead.

Keep plugging away at it, You will eventually get it working.




Bob, I have not started working with subform yet. So, do not have exact answer but it works very well on the main form.  I think this is the way to go if the list is very long, just like Diagnosis or Medicine in Medical Record making program. Where do you have so much use of subform?  Just wondering....
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Selection box
Reply #13 - Jan 27th, 2004 at 1:49am
Print Post Print Post  
Quote:
  Where do you have so much use of subform?  Just wondering....


Bharat,

The more I use them the more uses I find for them. Imagine in your  case the top of your main screen is your generic patient info then you have a subform on the right side that has your patient scheduleing system. Then the rest of your screen has tabs. 1 tab has a tableview subform of all of the previous visits that patient has had. Another tab has a subform to all the billing dates amounts and codes for that patient. You can have subforms that tracks all the meds and scripts you have written. When you select a patient all the data is called from all the separate databases and instantly viewable on 1 form. Using Sesames visibility feature you can make elements appear or disappear based on the user. This will keep you Hippa compliant. If you scan all your E.O.Bs  Imagine your collectors or billing person being able to see each one per activity. I have my test app using checkboxes to go out to a specific directory and placing a check in a box if a document {in your case  say insurance card }is available to view. Think of how much better your compliance can be if you had a checkbox for every paper you needed to have like Ins cards, Hippa release, superbill etc. and if the image was in the system you would know by the checkbox if anything was missing. Either your staff would see it or run a report weekly and work the problem files. I could go on for days but you probably get the jist. Smiley

The advantage of the subforms are you can have unlimited amount of events such as co payments a patient owes you 100.00 but he pays 10.00 a month you can just keep adding you never run out of fields. And using Sbasic yo have an element that calculates all billing owed minus each payment and you instantly know how much is owed on a patient by patient basis. But if you need to have an aging you can run it on the separate database and get a true aging based in line items. (I can go on for ever)

Give em a good try but be careful like Sesame Subforms are addicting!
  

Team – Together Everyone Achieves More
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: Selection box
Reply #14 - Jan 27th, 2004 at 3:34am
Print Post Print Post  
Bob, very interesting. I will have to start experimenting with it. It's indeed an eye opener as to what can be done with Sesame. Thank you very much for taking time to show me the possibilities.

The problem is when you have something working good, it is hard to put in substantial efforts. Just trying to convert a few databases and trying to see how everything is going to workout. I Like Sesame a lot. It has a lot to offer. See a lot of possibilities, however, cannot see putting up everything together and achieiving the same level of automization as with Q&A. With Q&A macro, just a single key to complete the most simplest operation to as complicated as preparing elctronic billing file, dumping it to bulletin board, get the file of the report, allocate them and posting them to respective records.....   and all these with one key (nested macros), and on the top of it,  you make macro stop at several places to accept input of data such as dates for record selections etc.  Custom Menu System makes it more user friendly and easy to train new employees.

Having said that, I believe, the developers have envisioned bigger and better plan. This is just a version 1.0. It is very impressive indeed. All that can be done in Q&A, one can accomplish that in Sesame using programming codes.  I only hope to learn them fast and use them.  Compared to codes, keys recording macro is little archaic, inefficient and error-prone.

Well, I have spent 14 years with Q&A to get where I am with my system. I hope to get a lot further with Sesame in considerable less time.

  
Back to top
 
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #15 - Jan 27th, 2004 at 3:06pm
Print Post Print Post  
Your conversation sounds fascinating. It is encouraging that others can accomplish lofty goals in sesame. I on the other hand can not get past basic selection lists. 

I took a fresh approach  last night and tried to simplify this process. I am trying this task with 2 single form databases for simplicity.

I started new db, 1 form 2 fields the fields are e1 and e2
I will use the sample zipcodes.db from sesame.

I put

XUserselectr("C:\Sesame\Data\zipcode.db", "zipcode!state", "State", "A"," Z", e2)

In on field exit  program of e1

I thought that when I exited field e1 I would receive a selection list made up of  info from the state field in Zipcode.db  then that info would return the selected state to field e2 once selection was made.

When I leave e1 sesame says working but it just runs indefinitely until I ctrl alt del to menu that says not responding.

What can I possibly have wrong in such a simple task?
  
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: Selection box
Reply #16 - Jan 27th, 2004 at 3:16pm
Print Post Print Post  
If you want to display the whole list, you just have to use xusrselect command. Why do you have to go through xuserselectr, start and end.... etc. Did you try the modified code for your form I posted to be placed in Purchase form in PurchaseFrom element and GlobalCode ?
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Selection box
Reply #17 - Jan 27th, 2004 at 4:23pm
Print Post Print Post  
Bill,

I have emulated exactly what you have described. I used zipcodes.db. and your logic of XUserselectr("C:\Sesame\Data\zipcode.db", "zipcode!state", "State", "A"," Z", e2)

I think I see why you think it is not working. 

After you exit e1 wait. DO NOT use task mgr to exit. It takes a while for some reason but after a few minutes it will bring up a selection list.

It took about 90 seconds for the selection list to be presented.

Let us know if this thought is correct. Thanks Smiley

I realize that it is working on 43042 records in Zipcode database but it still seems like an excessively long time to generate.

Can anyone explain why it is taking so long for this selection box?

I even changed  billgordons logic from a-z to XUserselectr("C:\Sesame\Data\zipcode.db", "zipcode!state", "State", "M"," P", e2) to see if it had a different effect. Still very slow.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Selection box
Reply #18 - Jan 27th, 2004 at 4:31pm
Print Post Print Post  
Bob,

The first time you use any of the "X" commands, it will be pretty slow depending on the size of the .db / .dat files you are accessing. Subsequent operations should be substantially faster - especially if you are using (the now available 1.0.1 release).

To avoid the slow first access, merge (always using a backup!) the two databases and use an internal xlookup.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #19 - Jan 27th, 2004 at 7:27pm
Print Post Print Post  
Yes Bob you were correct!  Thank you.

Now  Bharat_Naik to follow  your example and have it use what I place in a field and have a selection box . I put this  code  in Global Code   (even though I do not understand what it is doing)
 
stat vFieldName as String 
stat vStart as String 
stat vEnd as String 
 
Subroutine PickList_choose( ) 
 
vStart = @left (vFieldName, @in (vFieldName, "..") - 1) + @chr (1) 
vEnd = @left (vFieldName,   @in (vFieldName, "..") - 1) + "zzzzzzz" 
End Subroutine 

Then I placed this in my  e1 Element on element exit event.  I have adjusted it to the name of my new test  database name. 
 
if @in(e1, "..") > 0 then   
 

  vFieldName = e1 
  picklist_choose ( ) 
   
  e2 = @XUserselectR ("C:\Sesame\Data\zipcode.db", "zipcode!state", "state", vStart, vEnd) 
 
}

Nothing at all happens. What is wrong? 
  
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: Selection box
Reply #20 - Jan 27th, 2004 at 9:48pm
Print Post Print Post  
Bill, we are using this code for different purpose. What you want to do here is, put State Name in two letters and it should display the list of certain zipcodes for that state only.

The modified code might work for this purpose. I did not try it but this is mainly to shorten the list to display according to the initial string of the value.

As for example

If you want to have list of anything that begin with "Wh..", it will display white, whitehall, white House etc... from the whole list of say 3000 values.

  
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: Selection box
Reply #21 - Jan 27th, 2004 at 9:57pm
Print Post Print Post  
Bill, we are using this code for different purpose. What you want to do here is, put State Name in two letters and it should display the list of certain zipcodes for that state only.

The modified code might work for this purpose. I did not try it but this is mainly to shorten the list to display according to the initial string of the value.

As for example

If you want to have list of anything that begin with "Wh..", it will display white, whitehall, white House etc... from the whole list of say 3000 values.

  
Back to top
 
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #22 - Jan 28th, 2004 at 7:37pm
Print Post Print Post  
I am so FRUSTRATED!  I have read the book, read these posts over and over again. I still have not succeeded at doing what has been done before.

I now have 1 app with 2 databases
App is called myapp
Database 1 is entry
Database 2 is name

Database2 has a field called lastname
Dataebase1 has a field called ordername

I want to enter part of the last name in ordername field and when I exit ordername it will create a selection list from database2 lastname field with just the names that are close and when I select that name it returns that name to ordername.

Example. If I enter Smi the list would contain all the last names from database2 that start with SMI.

I am not the dumbest person in the world, even though it looks it at the moment. I have really put the time and effort into trying to accomplish this on my own but without  classes or more examples for me to learn from I am doomed.

I appreciate all the help I have received from people out here already, Bharat_Naik has put a lot of effort in trying to show me and I have traded emails with BOBSCOTT on things to try but to no avail

So please once again Bharat_Naik or BOBSCOTT or any other kind sole  please try to post  an example one more time with an explanation of what  programming I should have and what the programming is doing each step of the way.

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



Posts: 2530
Joined: Nov 22nd, 2002
Re: Selection box
Reply #23 - Jan 28th, 2004 at 8:33pm
Print Post Print Post  
For the example I have merged the example applications Gems.db and Customers.db.

By putting the following code in the On Exit of the Gem_Type LE of the "Gems Types" form of the "Gems Types" database:

// declare some variables - all strings
var v_result as string
var v_start as string
var v_end as string

// set start value to the contents of the field we are in
v_start = Gem_Type

// set the end of the range to that value with a bunch of "z"s
// tacked on to force the full alphabetic range. If the user puts
// "PAR" in the field, this wil force the range to include anything
// that starts with "PAR" through "PARzzzzzzzz" - including
// "PARIS" and "PARKMAN".

v_end = v_start + "zzzzzzzz"
v_start = v_start + @chr(1)

// In this application file, look at the form named "Main Form" for
// the LE named "City" - if its contents are in the range starting
// with what the user typed into "Gem_Type" and ending with
// that value with a bunch of "z"s concatenated on it - then
// return the value in "City" to the User Select list. If the user
// selects one of those City values, return the value in City and
// put it in the variable "v_result".

v_result = @XUserSelectR(@fn, "Main Form!City", "City", v_start, v_end)

// Put the value in "v_result" back into the LE "Gem_Type"
Gem_Type = aa


I got what I think you are asking for using Sesame 1.0.1. Remember that you need to test any of the X functions (XUserSelect, XLookup, etc..) using the actual Sesame runtime - not the Preview option of the Designer.

I stripped out all the error checking and other niceties, so this would be easier to follow. The lines beginning with "//" are comments and you do not need to type those in, they are there to give you a blow by blow explanation of what is happening.

The hard parts here are that you have to remember to use the form name when specifying the "ext select", but *not* use it again for the "source". So the external select is:

Form Name!LE Name - in the example: "Main Form!City"

But the "source" is just "City".

In the your example you would probably use something like:

//------------------ On Exit from ordername
var v_result as string
var v_start as string
var v_end as string

v_start = ordername

v_end = v_start + "zzzzzzzz"
v_start = v_start + @chr(1)
v_result = @XUserSelectR(@fn, "entry!lastname", "lastname", v_start, v_end)
ordername = v_result
//-----------------------------

if your form is named the same thing as your database (it usually is).

I hope this helps. If you have any questions at all - do not be afraid to ask.
« Last Edit: Jan 29th, 2004 at 3:03pm by The Cow »  

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


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Selection box
Reply #24 - Jan 28th, 2004 at 10:10pm
Print Post Print Post  
Mark Lasersohn,

I can not speak for Bill but I sure liked your step by step explanation. Thanks Cheesy

I have one problem when I apply your example to my application. Everything works fine in the creation of the pop-up list, However it does not return the value to my element.

I thought possibly this is because it is returning the value to an elelement on a subform so I tried this from the actual form and still had the same result.

I then added the writeln line to display the value of V_result

eventphysican = v_result 
writeln(V_result)

The widow shows it is empty nothing to return.

Thoughts?

Thanks,

Robert
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Selection box
Reply #25 - Jan 28th, 2004 at 10:15pm
Print Post Print Post  
What does @error say about it. The X functions will set @error if they fail.

  

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


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Selection box
Reply #26 - Jan 28th, 2004 at 10:34pm
Print Post Print Post  
Quote:
What does @error say about it. The X functions will set @error if they fail.

I put this in
eventphysican = v_result 
writeln(@error)

It returns a NO
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Selection box
Reply #27 - Jan 28th, 2004 at 10:53pm
Print Post Print Post  
Is it meant to return the same LE that appears in the menu or a different LE on the same form?
  

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


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Selection box
Reply #28 - Jan 28th, 2004 at 11:11pm
Print Post Print Post  
In this instance I was returning the same. I was following along with yours, Bharat and Bills examples.

var v_result as string
var v_start as string
var v_end as string

v_start = eventphysican

v_end = v_start + "zzzzzzzz"


v_result = @XUserSelectR(@fn, "physicians!last", "last", v_start, v_end)

eventphysican = v_result 
writeln(@error)
  

Team – Together Everyone Achieves More
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: Selection box
Reply #29 - Jan 28th, 2004 at 11:22pm
Print Post Print Post  
Mark, it still does not work with space without putting @chr (1) in var v_start for the search for the whole word which is followed by a space.

"Blue" would not pull up Blue Cross

Bl  will list everything starting with Bl.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Selection box
Reply #30 - Jan 29th, 2004 at 3:00pm
Print Post Print Post  
Quote:
Mark, it still does not work with space without putting @chr (1) in var v_start for the search for the whole word which is followed by a space.

"Blue" would not pull up Blue Cross

Bl  will list everything starting with Bl.


Darn it! you are right. I fixed it, then commented the fix out so I could test the work-around (adding @chr(1)), and didn't get the fix back in in time for testing. My mistake. It'll be in 1.0.2 - you are right.

Very sorry.

Please note that I went back and modified my example to Bill to reflect this change.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
Re: Selection box
Reply #31 - Jan 29th, 2004 at 10:02pm
Print Post Print Post  
Quote:
Mark Lasersohn,

I can not speak for Bill but I sure liked your step by step explanation. Thanks Cheesy


Yes I am happy. The example is just my speed. I have the selection working now but I am having the same problem Bob described of not having the data from the selection box go to my field.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Selection box
Reply #32 - Jan 29th, 2004 at 10:18pm
Print Post Print Post  
Could either Bill Gordon or Bob Scott please post your @XUserSelect statements?

I have:

aa = @XUserSelect(@fn, "Main Form!City", "City", v_start, v_end)

in my "merged" Gems and Customers application, running from the GemTypes form and selecting from the Customers form ("Main Form"). Values are being returned nicely.
  

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


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Selection box
Reply #33 - Jan 29th, 2004 at 10:32pm
Print Post Print Post  
This is what I have. I pretty much just copied yours and Bharats examples. Thanks


var v_result as string
var v_start as string
var v_end as string

v_start = eventphysican


v_end = v_start + "zzzzzzzz"
v_start = v_start + @chr(1)

v_result = @XUserSelectR(@fn, "physicians!last", "first", v_start, v_end)

eventphysican = v_result 


  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Selection box
Reply #34 - Jan 29th, 2004 at 11:23pm
Print Post Print Post  
Bob,

In your case if you change:

v_result = @XUserSelectR(@fn, "physicians!last", "first", v_start, v_end)

to:

v_result = @XUserSelectR(@fn, "physicians!last", "PhysFirst", v_start, v_end)

It will start working. The "source" argument wants to be the "Field Name" not the "Layout Element Name". So if you look to see what the "data source" is for that LE - that will be the name you want.

Explanation: Because an external database does not have a form open, and any one field may appear on multiple forms as the data source of different LEs, which may or may not share names, we can't know which LE name was intended.

BTW: This is something that may change in a near future release.
  

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


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Selection box
Reply #35 - Jan 29th, 2004 at 11:51pm
Print Post Print Post  
Thanks once again!  Smiley

It works like a charm.

  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Selection box
Reply #36 - Jan 30th, 2004 at 6:44pm
Print Post Print Post  
Is there a recommended method of creating a multi column selection list or pick list?

What I mean by multi column selection list is the ability to display multiple columns.

In the selection list example followed in previous posts we successfully created a selection list showing last names from another database. The problem here is there could be more then one Smith. So the selection box could display the last name plus the city and state so a user can select the correct one.

I could create a field in the external database that would be made up of name + city + state to use as the selection field but I thought there might be a better method using Arrays or ?? that Sesame has to offer.  Any Suggestions?


What I mean by multi column pick list is the ability to display multiple columns
And return multiple columns. Say we have a selection list for line items. We search on a field called category. The selection list brings up the item number, price, desc, etc. when a selection is made it returns many of the values to the correct fields.

Once again I could have a field in my line items database that is  item number + price + desc, etc and then have it return a key number and then have xlookups run that fill each field but is there a better way?

All suggestions appreciated.

Thanks
  

Team – Together Everyone Achieves More
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: Selection box
Reply #37 - Jan 30th, 2004 at 7:11pm
Print Post Print Post  
Bob, I understand exactly why it is so important. As a matter of fact, I asked the same question in the following link.

http://www.lantica.com/Forum2/cgi-bin/yabb/YaBB.pl?board=gen_disc;action=display...

Quote:
I did not use Q&A 5 (used QA4), so I am not familiar with XuserselectR commands or functions, but from whatever you have described, it seems to be very useful for data entry.       Is there anyway it can display more than one columns of data with Sesame using XUSR command or function but it selects the data from one specified column only, in the data field you are working on?

Thanks to all of you for sharing your expertise with this novice.


  
Back to top
 
IP Logged