Avatar of Murray Brown
Murray Brown
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

VB.net Will running a query in Access automatically run sub queries

Hi

I have a VB.net project that fills a DataGridView with an Access query.
Will this automatically run any sub queriesrelated to this query.
See code below for this
Sub FillDGV_Supplier(ByVal Status As String)
        Try

            Dim sSQL As String

            If Status = "Unpaid" Then
                sSQL = "Select * From [Supplier Totals Unpaid]"
            ElseIf Status = "Paid" Then
                sSQL = "Select * From [Supplier Totals Paid]"
            Else
                sSQL = "Select * From [Supplier Totals All]"
            End If





            Dim connection As New OleDbConnection(ConnectionString)
            Dim dataadapter As New OleDbDataAdapter(sSQL, connection)
            Dim ds As New DataSet()
            connection.Open()
            dataadapter.Fill(ds, "Suppliers_table")
            connection.Close()
            DataGridView_Supplier.DataSource = ds
            DataGridView_Supplier.DataMember = "Suppliers_table"

            Total_Supplier_Boxes()

            'Me.DataGridView_Supplier.Columns(1).Width = 25

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

Open in new window

Visual Basic.NETMicrosoft Access

Avatar of undefined
Last Comment
Murray Brown

8/22/2022 - Mon