|
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? |