Ali,
>I have a Cities business object build on cities table which has two fields: city_id and city_name.
>
>I have a Customer table which has HeadOfficeCity_id and ShipCity_id fields.
>
>Using Cities business object as two different combo boxes, How can I control the HeadOfficeCity_id and ShipCity_id fields on the same form?
You can use a single instance of the Cities business object as the binding source to fill the two combo boxes, specifying the display member and value member. You can then bind the comboboxes selected value to the Customer business object, specifying the two different value members. For example:
1. HeadOfficeCity combo box:
BindingSource: Cities
BindingSourceDisplayMember: city_name
BindingSourceValueMember: city_id
BindingValueSource: Customer
BindingValueSourceMember: HeadOfficeCity_id
2. ShipCity combo box:
BindingSource: Cities
BindingSourceDisplayMember: city_name
BindingSourceValueMember: city_id
BindingValueSource: Customer
BindingValueSourceMember: ShipCity_id
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com