Page 1 of 1

Joined Fields Refreshing in TMyQuery

Posted: Thu 18 May 2006 14:27
by ACS2000
SELECT
sm.*,
cm.Cust_Name
FROM
tms.salemain sm
LEFT JOIN tms.custmain cm ON sm.Cust_Code = cm.Cust_Code
ORDER BY
sm.SO_No

When editing a record from the above query the cust_code doesn't update until the record is posted then refreshed.

Is there any way that as soon as you've exited the field that Cust_Code will refresh while still editing?

Posted: Fri 19 May 2006 08:21
by Antaeus
Please specify what fields do you edit and for what table do you want field Cust_Code to be updated. Where do you assign value to Cust_Code field, on the client or on the server?

Posted: Fri 19 May 2006 09:14
by ACS2000
I'm using a form in delphi with TDBEdit controls to edit the different fields in a record.

I'm using a TMyQuery with a standard TDataSource.

In the salemain table there is a field called Cust_Code which relates to the Cust_Code field in the custmain table. I'm using the LEFT JOIN so that when the field salemain.cust_code is entered on the form the Customer's Name from custmain.cust_name is displayed. However, the Customer's Name doesn't show until the record is posted AND refreshed.

I want the Customer's Name to display immediately after the user has entered the Customer's Code and exited the TDBEdit control.

I know that a lookup field would work, but I'm trying to keep the number of components down and also keep as much processing at the server end as possible. Also with lookup fields you can't sort or filter by them.

Hope this is anough information. Your reply would be appreciated.

Thanks

Posted: Fri 19 May 2006 11:03
by Antaeus
Unfortunately in this case Cust_Name can be updated automatically only after posting and refreshing edited record. We can't suggest any simple way to solve this problem.