Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 16044

How to link between parent and child in visual basic 2019 form ?

$
0
0
Dear All

I want to link between Parent Form with controls and Child Form as a data grid view , I made the SQL connections, the problem is when I navigate the parent form the child form does not navigate with it , Here is the code

Code:

Dim dsMain, dsSub As New DataSet
        databaseconnection()
        Dim SqlMain = "SELECT * FROM tbl_Tenders_Main"
        Dim daMain = New SqlDataAdapter(SqlMain, connection)
        daMain.Fill(dsMain, "Main")
        BS1.DataSource = dsMain.Tables("Main")
        txt_TenderNo.DataBindings.Add("Text", BS1, "TenderNo")
        BindingNavigator1.BindingSource = BS1

        Dim SqlSub = "SELECT TenNo, TransNo, TransDesc, TSDate, TStatus FROM tbl_Tenders_Sub INNER JOIN tbl_Tenders_Main ON tbl_Tenders_Sub.TenNo = tbl_Tenders_Main.TenderNo"
        Dim daSub = New SqlDataAdapter(SqlSub, connection)
        daSub.Fill(dsSub, "Sub")
        BS2.DataSource = dsSub.Tables("Sub")
        DataGridView1.DataSource = BS2
        connectionclose()

What should I do to link between the navigator and the child to navigate with the parent together.

Thanks, Regards

Moheb Labib

Viewing all articles
Browse latest Browse all 16044

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>