By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 2,015 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

Combo Box using lookup values default to first value, not to parent table value

P: n/a
Hello,
I am creating a windows application database. I have a primary table
'Individuals' and a lookup table 'Prefixes.' In the Individuals table,
I have a column 'PrefixID' that references values of prefixes from the
Prefix table based on the PrefixID in the Prefix table.

When I load a windows application form, I can display and update data
from the primary table. This includes the prefixID value. If I
display a combo box with records from the Prefix table, I can select a
value from the combo box to update the prefixID in the Individuals
table. Unfortunately, the combo box defaults to the first value in the
PrefixID table; it does not default to the value of the prefixID in the
individuals table.

It seems as though I need to associate the combo box value with the
Individuals.prefixID value when the form loads, but I do not know how
to code it. Here is the code for the data entry form load with the
table adaptor for prefixes.

private void frmIndivDataEntry_Load(object sender, EventArgs e)
{

// TODO: This line of code loads data into the
'individualDS.tblPrefixes' table.
this.tblPrefixesTableAdapter.Fill(this.individualD S.tblPrefixes);

}

Anyone have ideas on how to have a the lookup combo box present the
lookup value based on the prefixID value in the parent table?

Jul 29 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.