Question Get Data from another Form

Papadopaulus

New member
Joined
Dec 23, 2013
Messages
2
Programming Experience
Beginner
As shown on the picture below, how can I get the item name in form 2 automatically as I choose the Item ID in form 2?
The Item ID and Item Name store in Form 1 database.



 
i suggest to add a radio button next to the item id in the form 2 and try this code :

public sub datagridshow
dim ds as new dataset
dim dt as new datatable
ds.tables.add(dt)
dim da as new oledbdataadapter
da=new oledbdataadapter("select item Name from
(the name of datatable which contains the item name) where item id="& combobox.text &"" (put the number of the combobox or the list item or the textbox )
da.fill(dt)
datagridview1.datasource=dt.default view.


s :)
and then in the radio button copy the code below


if radiobutton.checked=true then

datagridshow

end if.



I hope it works and good luck :)
 
Back
Top