Results 1 to 4 of 4
  1. #1
    saudkazia is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2015
    Location
    India
    Posts
    71

    how to relate between main and sub invoice

    i am trying to create a invoice/inventory database.



    i have created tables (examples of fields and other fields do exist but shortened as they are not relevant in this question. assume id being autonumber and is written id for the sake of it is actually tablename_id)

    products table (generic items can be reused)
    id, name, model, price, prod_desc

    accessories table generic items can be reused
    id, accessory, price, acc_desc

    invoice
    id, invoice_date, customer, total amount, paid (yes/no), payment_type

    invoice detail
    id, invoice_no, item_no, unit price, qty


    when i create the invoice form i need to ensure that i have two subforms that will show the item details for the products and for the accessories as the details in each will vary significantly.

    what is the best way to go about doing this. basically i need to map the item detail to the product or accessories.

    example

    Main Job
    1. Dining Table a, b, c, d, e, f, g, h, (different fields) amount, qty, subtotal calculated
    2. bed a, b, c, d, e, f, g, h, (different fields) amount, qty, subtotal calculated
    Total
    accessories
    1. table cover i,j,k,amount, qty, subtotal calculated
    2. pillows i,j,k,amount, qty, subtotal calculated
    3. mattress i,j,k,amount, qty, subtotal calculated
    Total

    grand total

    how would i be able to relate all the subforms to the main invoice form without creating too many tables for transactions

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Make a union query....
    all items in main
    union
    all items in accessories.

  3. #3
    saudkazia is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2015
    Location
    India
    Posts
    71
    they will different fields and number of fields

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    If this is what you are wanting,
    then you,must compensate each query so they BOTH have the same fields.
    even tho some will be empty.

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

Similar Threads

  1. Replies: 4
    Last Post: 10-01-2016, 09:19 AM
  2. Replies: 2
    Last Post: 09-14-2015, 09:01 AM
  3. Replies: 3
    Last Post: 11-19-2012, 05:05 PM
  4. Replies: 1
    Last Post: 10-10-2012, 01:05 PM
  5. doesn't relate
    By mhh12 in forum Programming
    Replies: 1
    Last Post: 08-01-2010, 11:55 AM

Tags for this Thread

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