Normal Topic XLookup Confusion... (Read 4084 times)
miss_doo
Member
*
Offline


half of the people you
know are below average

Posts: 18
Location: chicago, il
Joined: Dec 21st, 2004
XLookup Confusion...
Dec 21st, 2004 at 5:53pm
Print Post Print Post  
hi everybody, i'm new to this forum and to sesame, but i'm hoping someone can help.

i've browsed the other postings, both current and archive, and i can't seem to figure out why i'm having problems with an XLookup.

in my application i have 3 databases: zipcodes, orders, and customers.  using my orders form (ORD2005) i want be able to insert an area code based on a ship to zip, and i'm trying to get this information from my zipcodes database.

i've tried the following (in a live sesame application) with no results:

XLookup(@fn, Ship to Zip, "ZipList04!Zip", "Area Code", Ship to Area Code)

am i completely off base?  this is my first application, and i have all the other programming down, but i'm completely hung up on the XLookups.

any advice would be greatly appreciated.   

miss doo
  

~ miss doo&&&&a burning dog needs no chimney, and time heals all non-fatal wounds
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: XLookup Confusion...
Reply #1 - Dec 21st, 2004 at 6:10pm
Print Post Print Post  
Hello Miss Doo,

The Syntax for the XLookup looks correct as long as the names are correct.

Things to check would be

1. Check to be sure that "Ship to Zip" and "Ship to Area code" are the element names on the current form.

2. Check to be sure that ZipList04 is the name of the Zipcode form.

3. Check to be sure that "Zip" and "Area Code" are the element names on the Zipcode form.

Element Names can be different than Element Labels so to be sure of the names, you will want to use the "Other" tab of the property viewer.

The other thing to be aware of is Preview mode. The X-Family commands do not run in Preview mode so you will have to reconcile to your existing application or save as a new one to test the XLookup.

Also if your application has security be sure you have the X Username and X Password set to a valid Username and Password.

-Ray
  

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


half of the people you
know are below average

Posts: 18
Location: chicago, il
Joined: Dec 21st, 2004
Re: XLookup Confusion...
Reply #2 - Dec 21st, 2004 at 9:00pm
Print Post Print Post  
hi ray!

thanks for your response...  everything matches up on 1-3 in your response.  i've also confirmed that i have the correct element names, and that i'm NOT in preview mode when i run the XLookup.  i've also gone into security manager and have confirmed that there are no security measures put in place... 

unfortunately, i just can't seem to get this work. 

i'm going to putter around with an @XLookup, and maybe will have more luck with that. 

is it possible that i've done something else wrong to hinder the XLookup?

thanks for helping a newbie out.

miss doo


  

~ miss doo&&&&a burning dog needs no chimney, and time heals all non-fatal wounds
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: XLookup Confusion...
Reply #3 - Dec 21st, 2004 at 9:41pm
Print Post Print Post  
Hello Miss Doo,

If you would like you can send your .DAT and .DB files to Support@Lantica.com and we will gladly have a look at them and see if we can help you figure out the Xlookup.

-Ray
  

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


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: XLookup Confusion...
Reply #4 - Dec 21st, 2004 at 10:07pm
Print Post Print Post  
Quote:
hi everybody, i'm new to this forum and to sesame.


Welcome to the Forum Miss_doo,

I am sure you will find help here, as you have seen already Ray is quick to offer terrific service.

You will find that besides Sesame  being a great product the support that  Lantica gives to us end users is second to none.

Best of Luck with your application. Smiley
  

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


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: XLookup Confusion...
Reply #5 - Dec 21st, 2004 at 10:50pm
Print Post Print Post  
Quote:
XLookup(@fn, Ship to Zip, "ZipList04!Zip", "Area Code", Ship to Area Code)
This is the function you are using but you don't mention how it is failing.   What are the symptoms?  No answer, wrong value, 0, error message, other symptoms?

XLU will return a string.  If the destination element (Ship to Area Code) is bound to a number field,  then you will not get what you want. 

You may need to convert the result of the XLU statement to a number like this:
Quote:
Ship to Area Code = @ToNumber( @XLookup(@fn, Ship to Zip, "ZipList04!Zip", "Area Code"))


You could also insert an @ERROR command following the XLU statement to verify the XLU is actually working correctly:
Quote:
Ship to Area Code = @ToNumber( @XLookup(@fn, Ship to Zip, "ZipList04!Zip", "Area Code"))

IF @ERROR THEN {
.....@MSGBOX("The XLU statement failed.","","")
.....}
ELSE {
.....@MSGBOX("The XLU statement worked correctly","","")
.....}



====================
Above code was modified to include missing "@" in last two  XLU examples.  Thanks to Ray for catching that.
« Last Edit: Dec 22nd, 2004 at 3:18pm by Bob_Hansen »  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: XLookup Confusion...
Reply #6 - Dec 22nd, 2004 at 2:43pm
Print Post Print Post  
Quote:
Ship to Area Code = @ToNumber( XLookup(@fn, Ship to Zip, "ZipList04!Zip", "Area Code"))


Bob,

You forgot to change the XLookup to an @Xlookup, since you eliminated an argument. The code would look something like this.

Code
Select All
Ship to Area Code = @ToNumber(@XLookup(@fn, Ship to Zip, "ZipList04!Zip", "Area Code"))
 



-Ray
  

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


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: XLookup Confusion...
Reply #7 - Dec 22nd, 2004 at 3:20pm
Print Post Print Post  
Thanks Ray......I have corrected the original.  that's what I get for doing Cut/Paste and not testing. 

Have a great Christmas.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
miss_doo
Member
*
Offline


half of the people you
know are below average

Posts: 18
Location: chicago, il
Joined: Dec 21st, 2004
Re: XLookup Confusion...
Reply #8 - Dec 22nd, 2004 at 3:20pm
Print Post Print Post  
>> does happy dance in office, frightening fellow co-workers <<

thanks for all your help guys!

bob, my hero, the @Number did the trick.

thanks again, and happy holidays!

miss doo
  

~ miss doo&&&&a burning dog needs no chimney, and time heals all non-fatal wounds
Back to top
 
IP Logged