?
Solved

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

Posted on 2011-10-06
3
Medium Priority
?
390 Views
Last Modified: 2012-05-12
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

0
Comment
Question by:Murray Brown
3 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 36923401
Do you mean queries that are used to build the top-level query? If so, then yes, it would.
0
 
LVL 5

Expert Comment

by:bitref
ID: 36923562
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.
0
 

Author Closing Comment

by:Murray Brown
ID: 36923772
Thanks very much
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question