Normal Topic Minor XLU puzzler (Read 771 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Minor XLU puzzler
Aug 8th, 2006 at 3:36pm
Print Post Print Post  
I have several spots in my Workorder database where a user must assign a type of vehicle to a job.  I have three fields I'm dealing with: Vehicle_1_Code, Vehicle_1_Description and Vehicle_1_Rate.

I have crafted the Vehicle_1_Description element as a combo box.  The element fills on-entry with a list of vehicle types using @XListValues and PopulateListElement with values from Trailers.db.

Once filled, On-Change does an XLU into Trailers.db and puts the appropriate code into Vehicle_1_Code.

Now, in the On-Element-Change programming of Vehicle_1_Code I have:
Code
Select All
// Looks up Vehicle 1 Description and Rate based on the Code

If Not @IsBlank(VEHICLE_1_CODE)
	THEN
	{
	XLU("TRAILERS.db",VEHICLE_1_CODE,"VEHICLE_CODE","DESCRIPTION",VEHICLE_1_DESCRIPTION)
	XLU("TRAILERS.db",VEHICLE_1_CODE,"VEHICLE_CODE","RATE",VEHICLE_1_RATE)
	} 



This will work (gets the rate), but only if I manually enter a code into Vehicle_1_Code and then exit the box.  It does not work when the lookup from the Description field fills the box.

Any idea what I'm missing?  Should I just put the lookup programming in both the code and the description elements? 

  

**
Captain Infinity
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: Minor XLU puzzler
Reply #1 - Aug 8th, 2006 at 7:18pm
Print Post Print Post  
On Element Change runs when the User changes the Data. Since you as the Programmer are changing that data, you need to also change other data that may depend on that information. So you will need to put the rate code in the Description element as well.

-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Minor XLU puzzler
Reply #2 - Aug 8th, 2006 at 7:21pm
Print Post Print Post  
And again, thanks.
  

**
Captain Infinity
Back to top
IP Logged