Results 1 to 6 of 6
  1. #1
    blueraincoat is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2011
    Location
    Shanghai,CHN
    Posts
    99

    Making a PurchaseOrder form

    Hi Guys,
    I'm working on a purchase order form. The PK of tblpurchaseorder is PO(purchase order) & PN(part number).
    I want the form to be something like a report, I mean when you key in the first item, it stayed in the form, and you just moved to a new row and key in another item. So I made a subform basing on the tbl, and I embeded it into another form which is the attachment by the end. I do not want to key in the PO every time so i put it in the main form, but something must be wrong since everytime i move the focus from the PO to the PN, system gives me a warning that the PK should not be null.
    The basic intention is that I don't want to key in the same PO every time.
    Thanks in advance!
    Last edited by blueraincoat; 04-05-2011 at 12:29 AM.

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    If many parts are associated with a purchase order, then you have a one-to-many relationship which requires 2 tables a purchase order table and a related detail table. The following is a typical table structure for a purchase order system.

    tblPurchaseOrder
    -pkPurchaseOrderID primary key, autonumber
    -txtPurchaseOrder
    -dtePurchaseOrder (date of purchase order)
    -fkSupplierID foreign key to tblSuppliers

    tblPODetails
    -pkPODetailID primary key, autonumber
    -fkPurchaseOrderID foreign key to tblPuchaseOrder
    -fkPartNumberID foreign key to tblPartNumbers
    -Qty
    -unitPrice

    tblPartNumbers
    -pkPartNumberID primary key, autonumber
    -txtPartNumber
    -txtPartDescription

  3. #3
    blueraincoat is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2011
    Location
    Shanghai,CHN
    Posts
    99
    Thank you very much jzwp11.
    It's a very clear idea! Never thought it could be this easy.
    One addtional question, would it be OK that I don't use auto number in all these tables? For some reason the auto number seems uncontrolable to me ...

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Technically the primary key does not need to be an autonumber field, I just like to use them so I don't have to worry about it. The general rule is that the primary key should have no significance to the user, but there has been a lot of discussions on that. Additionally, it is best if the primary key is numeric since relational databases are more efficient with numeric fields in terms of matching and searching compared to text fields.

  5. #5
    blueraincoat is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2011
    Location
    Shanghai,CHN
    Posts
    99
    Thanks for the detailed explanation.

  6. #6
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You're welcome; good luck with your project.

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

Similar Threads

  1. Making a Stand Alone Form Available
    By PapaMammoo in forum Forms
    Replies: 1
    Last Post: 01-13-2011, 10:49 AM
  2. Help making a form with tables and querys
    By mentose457 in forum Forms
    Replies: 2
    Last Post: 12-06-2010, 06:00 PM
  3. making a table from a filtered split form
    By stephenaa5 in forum Queries
    Replies: 2
    Last Post: 08-25-2010, 08:56 PM
  4. Making the launched form seperate from Access
    By MonsterMaxx in forum Access
    Replies: 1
    Last Post: 09-06-2009, 12:11 PM
  5. Replies: 2
    Last Post: 11-17-2006, 01:07 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