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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

returning data from a lookup table form

Status
Not open for further replies.

budjo

Programmer
Mar 4, 2004
19
PH
hello ..i tried to search for the answer using the search function but all im getting is how to pass data to new created form , my problem is this .

I have a Form where I use to enter Item Details .. Item Details includes a field of "BRAND" , I have created a lookup table form where when the user will try to enter a brand for the item , the lookup table will be showed where the user can select one of the brands ...

Brand frm1 = new Brand()
frm1.Parent = this;
frm1.ShowDialog();

the lookup form has a listbox and a command button , my problem is how to pass back the selectedvalue of the listbox to the Form which called frm1 ???

thanks in advance ..

 
If the ListBox in frm1 is friend or public:
Code:
frm1.ShowDialog();
txtBrand.Text = frm1.ListBox1.SelectedValue;
If not, make a public property in frm1 that returns the selected value (more nice than making the ListBox public).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top