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.
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.
On the Field1 OnChange property, just set the value of field2 in the query your are using for your DBGrid.
ASKER
Dear ruanlab123,
Sorry, in the DBGrid field property don't have the onChange Property..
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
:-)
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
Regards
Sorry the DBGrid onChange event not property.
listening...
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why grade C?