Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid Drop-downs 1

Status
Not open for further replies.

BoydMT

Programmer
May 28, 2003
32
US
My app is connected to 3 SQL tables (tblCompanies, tblContacts, and tblProposals).
I've created a datagrid to maintain the data from tblProposals. This datagrid contains the following 4 fields: [CompanyName],[ContactName], [ContactTitle], and [ProposalID].

When the user clicks 'Edit', the [CompanyName] textbox changes to a drop-down list of possible companies from tblCompanies. Once this is selected, I need the [ContactName] drop-down list to populate with all Contacts from the selected [CompanyName] field. Any idea how this can be accomplished?

Furthermore, I would like the [ContactTitle] field to remain a label when 'Edit' is clicked, but automatically populate with the title that is associated with the selected [ContactName] in tblContacts.

I hope I haven't confused anyone, but any help/direction would be greatly appreciated.

Thanks,
Boyd
 
Siva -
Thanks for the reply.
I understand how to make a control a drop-down list when 'Edit' is clicked. What I can't figure out is how to populate another drop-down list based on what was selected from the first one.

For example, Table1 has the following records:
John Smith, ABC Corporation
Tom Johnson, ABC Corporation
Bill Williams, XYZ Inc
Bob Simpson, XYZ Inc

When the user selects ABC Corporation from the first drop-down, I want the second drop-down to only contain John Smith and Tom Johnson. If XYZ Inc is selected, Bill Williams and Bob Simpson should show up in the second drop-down list.

Thanks,
Boyd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top