1 Replies - 1557 Views - Last Post: 08 October 2011 - 10:56 AM Rate Topic: -----

#1 sellis1978  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 13-May 10

Help updating fields in an Access Database using VS2010

Posted 07 October 2011 - 02:06 PM

I'm trying to figure out how to update fields in an Access database through VB. What I'm supposed to do subtract the quantity of the daily orders from the inventory quantity. My textbook is a little bit vague at this point, because the only way it describes updating the DB is manually through the BindingSourceNavigator. I don't want to enter it manually, I want it to subtract the quantity from the orders table.

Public Class frmMicroland

  Private Sub frmMicroland_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.InventoryTableAdapter.Fill(Me.MicrolandDataSet.Inventory)
    Me.CustomersTableAdapter.Fill(Me.MicrolandDataSet.Customers)
    Me.OrdersTableAdapter.Fill(Me.MicrolandDataSet.Orders)
  End Sub

  Private Sub btnOutOfStock_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOutOfStock.Click
    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(" ")
    Dim query = From orders In MicrolandDataSet.Orders
                Join inventory In MicrolandDataSet.Inventory
                On orders.itemID Equals inventory.itemID
                Where orders.itemID = inventory.itemID
                Let quantity = orders.quantity
                Let itemID = orders.itemID
                Let itemDesc = inventory.description
                Select quantity, itemID, itemDesc


  End Sub
End Class


This is as far as I've got on it, and it just doesn't seem to be gellin. A little poke in the right direction would be nice.

Is This A Good Question/Topic? 0
  • +

Replies To: Help updating fields in an Access Database using VS2010

#2 icarus1984  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 08-October 11

Re: Help updating fields in an Access Database using VS2010

Posted 08 October 2011 - 10:56 AM

Where are you connecting to the Access DB in your code? Also, are you required to use Linq? If, not why not create query object in Access that returns for you the result you want and just call that from your code.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1