Murray Brown
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
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
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Yes, your Suppliers_table will be filled with any of the queries coded according to Status. Then, the filled Suppliers_table will populate the DataGridView.
ASKER
Thanks very much