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:
// 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?