Results 1 to 3 of 3
  1. #1
    Poohbear0471 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    78

    Northwind 2007 "Add to purchase order" onclick VBA modification

    I'm currently building on the Northwind Traders 2007 sample database to work for a home party plan consultant. The sample database includes an inventory list with a coded button to add the inventory item to a purchase order. I would like to have a separate button that would add all of the products to a single purchase order. Is this possible?



    This is the coding behind the button:

    Private Sub cmdPurchase_Click()
    If Not Me![Qty To Reorder] > 0 Then
    MsgBoxOKOnly NoNeedToRestock
    ElseIf Inventory.RestockProduct(Me![Product ID]) Then
    Me.Requery
    MsgBoxOKOnly RestockSuccess
    Else
    MsgBoxOKOnly RestockingFailed
    End If
    End Sub

    TIA - Ed

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Syntax for MsgBox is:

    MsgBox "Restock successful", vbOkOnly

    Batch adding records to purchase would requery an sql INSERT SELECT action. This can get rather complicated and has been discussed numerous times in forum. Here is one https://www.accessforums.net/program...nts-26223.html

    Don't know your data so can't offer specifics.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Poohbear0471 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    78
    Thank you!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  2. Replies: 2
    Last Post: 03-29-2012, 08:49 AM
  3. Replies: 11
    Last Post: 03-15-2012, 01:36 PM
  4. Replies: 2
    Last Post: 11-04-2011, 02:45 AM
  5. Northwind Purchase Order Number
    By jpl85716 in forum Access
    Replies: 3
    Last Post: 09-29-2010, 12:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums