Link to home
Start Free TrialLog in
Avatar of cmwong
cmwong

asked on

DBGrid Field value

Dear Experts,

I have a DBGrid where Field2 value will depends on the Field1 value. If Field1 value change, the field2 value will change also. and the Field1 has picklist.

Can anybody tell me how to do it?

Thanks.
Avatar of ruanlab123
ruanlab123
Flag of South Africa image

On the Field1 OnChange property, just set the value of field2 in the query your are using for your DBGrid.
Avatar of cmwong
cmwong

ASKER

Dear ruanlab123,

Sorry, in the DBGrid field property don't have the onChange Property..
Write an onChange event for your DBGrid. Try the example found at this PAQ:
https://www.experts-exchange.com/questions/20842900/DBGrid-question.html

Cheers
:-)
Or, as suggested in the same PAQ, try using the OnColExit event and enter there the code for updating the dataset.
Regards
Sorry the DBGrid onChange event not property.
Avatar of Goodangel Matope
listening...
Avatar of cmwong

ASKER

Dear calinutz,

I am using the onChange event as you say, however the field is a picklist.. when i change the field1 value using the the picklist, the field2 value does change..but the field1 value remain the same.. I don't understand why?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of calinutz
calinutz
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Why grade C?