Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8701063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:18:20+00:00 2026-06-13T02:18:20+00:00

I am trying to figure out how to display certain data from an access

  • 0

I am trying to figure out how to display certain data from an access database based on the button click. For example, if I clicked the Stock button then it would display the items from the database where the item is out of stock. I am able to open the connection and display query information but it is a long LINQ query that I am not sure where it came from. Any suggestions on how to display the database information? i.e. customer information, stock items, etc…

Option Strict On

Imports System.Data.OleDb

Public Class frmMicroland

Dim con As New OleDbConnection

Private Sub btnStockItems_Click(sender As System.Object, e As System.EventArgs) Handles btnStockItems.Click

    Dim query1 = From anyOrder In MICROLANDDataSet.Orders
                Join itsStockItem In MICROLANDDataSet.Inventory
                On anyOrder.itemID Equals itsStockItem.itemID
                Let orderQuantity = anyOrder.quantity
                Select itsStockItem.quantity, itsStockItem.description, anyOrder.itemID
                Order By quantity, itemID


    ''Test connection to make sure it opens first
    Try
        con = New OleDb.OleDbConnection("provider= microsoft.ace.oledb.12.0;Data Source = C:\Users\HPG62-220US\Documents\Visual Studio 2010\Projects\Asignment 9\Asignment 9\bin\Debug\MICROLAND.accdb; Persist Security Info=False;")
        Try
            Call con.Open()
        Catch ex As Exception
            MessageBox.Show("Could not connect")
        End Try

        If con.State = ConnectionState.Open Then
            MessageBox.Show("Connection is open")
        End If
    Catch ex As Exception
    End Try

    lstOutput.Items.Add("Here are the items that are out of")
    lstOutput.Items.Add("inventory or must be reordered.")
    lstOutput.Items.Add("")
    lstOutput.Items.Add("The numbers shown give the")
    lstOutput.Items.Add("minimum reorder quantity required.")
    lstOutput.Items.Add("")
    lstOutput.Items.Add(query1)
    con.Close()
End Sub

Private Sub btnTodaysOrders_Click(sender As System.Object, e As System.EventArgs) Handles btnTodaysOrders.Click

End Sub
End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:18:21+00:00Added an answer on June 13, 2026 at 2:18 am

    There are a few different things going on here…

    Firstly, you need to declare a variable outside of your btnStockItems_Click procedure that can store the returned dataset. sometihng like:

    Dim con As New OleDbConnection
    Dim ReturnedData as Datatable
    

    Then in your btnStockItems_Click procedure you need to populate that datatable:

    ReturnedData = query1.CopyToDataTable
    

    Now you have the data to use in each of the button clicks.

    The next problem I see is that it doesn’t seem you pulled in the correct data…
    For example, you never pulled in the order date in your query1, but you’re looking to know today’s orders.

    Assuming you fixed that and it was called, say “OrderDate” in query1, what you could do then is populate your listview with a linq query from your ReturnedData datatable something along the lines of:

    From rw in ReturnedData where OrderDate = xxx select rw.item("itemID").tostring
    

    … I’m doing this without an IDE, so spelling may be off, but I hope this gives you an idea of where to go…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out the best approach to display combined tables based on
I'm trying to figure out how to find a certain string and display how
I'm trying to figure out how to display the repeated letter in a string.
im new to android and I've been trying to figure out how to display
I'm trying to figure out the best way to display a long list of
Trying to figure out why my silverlight app suddenly just displays nothing (right click
Here's something I'm trying to figure out concerning display objects in ActionScript3 / Flex.
I am trying to figure out how to display the category of an article,
I am trying to figure out the best way to display the daily average
I am trying to figure out if there is a simple way to display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.