Hot Topic (More than 10 Replies) XLookup help needed (Read 2015 times)
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
XLookup help needed
Jun 12th, 2004 at 7:23pm
Print Post Print Post  
Hi

I have a 4 databases test application, Orders, Clients, Items and Products. Each have only one Form. Items has a subform, a relational link to Products by Product_ID. This part works OK. For test purposes, I created an LE called XLU_Product_Description on the Items form. This LE contains the following code:

XLookup("c:\Sesame\Data\Samples\Products.db" , Product_ID , "Product_ID" ,"Product_Description" , XLU_Product_Description)

The code is to execute "On Form Entry". It Tests OK and Reconciles properly but nothing happens in Sesame Database Manager. I see no product description when in Search Mode and using F10 to browse records. I'm stumpped. I would appreciate any help.

TIA

Serge
  

When all you have is a hammer, everything starts to look like nail!
Back to top
 
IP Logged
 
JFisher
Junior Member
**
Offline


No personal text

Posts: 51
Location: Roswell, NM
Joined: Jan 7th, 2004
Re: XLookup help needed
Reply #1 - Jun 12th, 2004 at 9:44pm
Print Post Print Post  
Serge,
I had a similar situation.  When retrieving a value using XLookup, the target LE would come up blank.  I subsequently found out that the target LE was an unbound element.  When I bound the LE properly to the database, the retrieved value would appear correctly.
Check to see that your LE, named XLU_Product_Description is actually a bound element.
Regards,
Jack
  
Back to top
 
IP Logged
 
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: XLookup help needed
Reply #2 - Jun 12th, 2004 at 10:31pm
Print Post Print Post  
Hi Jack

Thanks for thr reply.

I checked the LE property. It is bound to !XLU_Product_Description.  I tried to change the target name consequently but  the program would not compile. I really don't know  what to try next!

Regards

Serge
  

When all you have is a hammer, everything starts to look like nail!
Back to top
 
IP Logged
 
JFisher
Junior Member
**
Offline


No personal text

Posts: 51
Location: Roswell, NM
Joined: Jan 7th, 2004
Re: XLookup help needed
Reply #3 - Jun 13th, 2004 at 12:44am
Print Post Print Post  
I wish I could help more...
I checked my application.  It is a payroll application that does XLookup to a personnel database.  ...and it works.  The structure of my XLookup commands is identical to yours, except the names are different.  The only difference I can see is that I did not put spaces before and after the commas.  That should not make a difference (I think).  I would carefully check spelling, etc. next.

Maybe someone else has an additional idea.

Jack
  
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: XLookup help needed
Reply #4 - Jun 13th, 2004 at 11:10am
Print Post Print Post  
Quote:
The code is to execute "On Form Entry". It Tests OK and Reconciles properly but nothing happens in Sesame Database Manager. I see no product description when in Search Mode and using F10


Your code looks fine. I am wondering why have you put it in On Form Entry Event? Normally you will have such code on Element Exit Event of Product ID element. As it is now, you would not see the product description after entering the Product ID while adding data.  In order to view updated data, you may place this code on form entry event but that would be in addition to the one mentioned earlier. Does product ID field have proper Product ID when you enter the form while searching?
  
Back to top
 
IP Logged
 
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: XLookup help needed
Reply #5 - Jun 13th, 2004 at 11:41am
Print Post Print Post  
Hi Bharat_Naik

The reason I used On Form Entry is simply to see the Product Description while browsing the records, but for good measure, I followed your suggestion and included the same code on Element Exit Product_ID. It did not change anything. My item Form shows a Populated Product_ID LE But alas, no Product_Description.

Thanks for trying to help

Serge
  

When all you have is a hammer, everything starts to look like nail!
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: XLookup help needed
Reply #6 - Jun 13th, 2004 at 2:01pm
Print Post Print Post  
X-Family commands do not work in preview mode. Does your command work when you add a new record? When you enter Product Id and exit the field, does product description display?
  
Back to top
 
IP Logged
 
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: XLookup help needed
Reply #7 - Jun 13th, 2004 at 2:17pm
Print Post Print Post  
Hi again

No. It does not work in Add Mode in the Items Database.

Serge
  

When all you have is a hammer, everything starts to look like nail!
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: XLookup help needed
Reply #8 - Jun 13th, 2004 at 2:33pm
Print Post Print Post  
Are you getting a value from @error?
  

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


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: XLookup help needed
Reply #9 - Jun 13th, 2004 at 3:03pm
Print Post Print Post  
I'l try later on

Thanks
  

When all you have is a hammer, everything starts to look like nail!
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: XLookup help needed
Reply #10 - Jun 13th, 2004 at 3:04pm
Print Post Print Post  
Quote:
I have a 4 databases test application, Orders, Clients, Items and Products. Each have only one Form. Items has a subform, a relational link to Products by Product_ID. This part works OK. For test purposes, I created an LE called XLU_Product_Description on the Items form. This LE contains the following code:

XLookup("c:\Sesame\Data\Samples\Products.db" , Product_ID , "Product_ID" ,"Product_Description" , XLU_Product_Description)


We have tendency to use terms Database and Application interchangably. It is not so. In Sesame, one application can and usually contain many databases. In the application where you have subform contain at least two databases.

Since you have Item Form with Subform Product, I believe Item and Product databases belongs to the same application.

If this is the case, the xlookup of the product ID is from the same application but from Product database. (Product form)

XLookup  (@fn ,  Product_ID ,  "Product!Product_ID" ,  "Product_Description" , XLU_Product_Description)

Where "Product" is the name of the form.

Please also make sure that you are not operating in Preview mode in which Xlookup commands do not work.
  
Back to top
 
IP Logged
 
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: XLookup help needed
Reply #11 - Jun 13th, 2004 at 3:15pm
Print Post Print Post  
Hi

Unless I misunderstand the concept, my 4 databases are in the same application. Here is a variant I used...

XLookup("C:\Sesame\Data\Samples\Products.db",Product_ID,"Product_Form!Product_ID
","Product_Description",XLU_Product_Description)


Regards

Serge
  

When all you have is a hammer, everything starts to look like nail!
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: XLookup help needed
Reply #12 - Jun 13th, 2004 at 3:49pm
Print Post Print Post  
If you have all four databases in the same application, you can repalce the application name with @fn.

XLookup (@fn, Product_ID, "Product_Form!Product_ID", "Product_Description", XLU_Product_Description)
  
Back to top
 
IP Logged
 
jondolar
Junior Member
**
Offline


Keep Trying

Posts: 57
Location: Montreal Canada
Joined: Dec 25th, 2003
Re: XLookup help needed
Reply #13 - Jun 13th, 2004 at 7:33pm
Print Post Print Post  
Hi Bharat

Quote:
If you have all four databases in the same application, you can repalce the application name with @fn.


That did it for me. I don't know why since my original code contained the full path of the looked up Database.
Maybe Mark Has an answer to this! Wink

Many thanks for your patient help.

Regards

Serge
  

When all you have is a hammer, everything starts to look like nail!
Back to top
 
IP Logged