Consulting

Results 1 to 5 of 5

Thread: Relation or array

  1. #1
    VBAX Regular
    Joined
    Jan 2016
    Posts
    51
    Location

    Relation or array

    Hello,



    Looking for solution.

    A warehouse, In that house is
    one scaffolding
    with 8 shelfs,
    and each shelf has 8 products.

    Looking for a relationship between tables (and which tables) or a solution for an array. It cost me days to find something about this subject on the internet

    Guidance will be welcome
    TonC

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,391
    Location
    To effectively manage warehouse storage in an Access database, you'll want to create a relational database structure. Here's how you can set up the tables and relationships:
    Tables:

    1. Warehouses:

      • WarehouseID (Primary Key, AutoNumber): Unique identifier for each warehouse.
      • WarehouseName (Text): Name of the warehouse.
      • WarehouseLocation (Text): Address or location of the warehouse.
      • Other relevant fields (e.g., Capacity, ContactPerson).

    2. StorageRacks:

      • RackID (Primary Key, AutoNumber): Unique identifier for each storage rack.
      • WarehouseID (Foreign Key): Links each rack to a specific warehouse.
      • RackName (Text): Name or identifier for the rack (e.g., "Rack A1").
      • Other relevant fields (e.g., RackType).

    3. Shelves:

      • ShelfID (Primary Key, AutoNumber): Unique identifier for each shelf.
      • RackID (Foreign Key): Links each shelf to a specific storage rack.
      • ShelfNumber (Integer): Number or identifier for the shelf within the rack (e.g., 1, 2, 3...8).
      • Other relevant fields (e.g., Capacity).

    4. Products:

      • ProductID (Primary Key, AutoNumber): Unique identifier for each product.
      • ProductName (Text): Name of the product.
      • ProductDescription (Text): Description of the product.
      • Other relevant fields (e.g., SKU, QuantityInStock, UnitPrice).

    5. StockLocations

      • StockLocationID (Primary Key, AutoNumber): Unique identifier for each stock location.
      • ShelfID (Foreign Key): Links each stock location to a specific shelf.
      • ProductID (Foreign Key): Links each stock location to a specific product.
      • Quantity (Integer): The quantity of the product at that location.

    Relationships:

    • Warehouse to StorageRacks: One-to-many relationship. One warehouse can have many storage racks.
    • StorageRacks to Shelves: One-to-many relationship. One storage rack can have many shelves.
    • Shelves to StockLocations: One-to-many relationship. One shelf can have many stock locations.
    • Products to StockLocations: One-to-many relationship. One product can be in many stock locations.

    Explanation for Access:
    In Microsoft Access, you would create these tables and then define relationships between them using the Relationships window. The key is to use Primary Keys (unique identifiers for each record in a table) and Foreign Keys (fields in one table that link to the Primary Key in another table).

    • The WarehouseID is the Primary Key in the Warehouses table. In the StorageRacks table, it's a Foreign Key, linking each rack to its warehouse.
    • Similarly, RackID is the Primary Key in StorageRacks and a Foreign Key in Shelves.
    • ShelfID is the Primary Key in Shelves and a Foreign Key in StockLocations.
    • ProductID is the Primary Key in Products and a Foreign Key in StockLocations.

    This structure allows you to efficiently query and manage your data. For example, you can:

    • Find all storage racks in a specific warehouse.
    • List all shelves in a particular rack.
    • Determine which products are stored on a given shelf.
    • Track the quantity of each product at each specific location.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  3. #3
    VBAX Regular xps350's Avatar
    Joined
    Jul 2022
    Posts
    15
    Location
    As there is only one warehouse and one scaffolding, just the shelves (storage locations) are relevant.
    You need (at least) three tables:

    • StorageLocation
    • Product
    • StockMovement.


    In the StockMovement table you will fields like:
    • StorageLocationID
    • ProductID
    • Quantity (+ or -)
    • Date/time.
    Groeten,

    Peter

  4. #4
    VBAX Regular
    Joined
    Jan 2016
    Posts
    51
    Location
    Hello,

    Sorry, I think i was not clear about my intentions

    A warehouse, In that house is
    one scaffolding or one rack.
    with 8 shelfs,
    and each shelf has 8 products, and each of those products, has 8 descri[ptions.

    I want to choose with a combo box which shelf I want for example shelf1, shelf2, etc etc
    until shelf8.

    Sofort I want to use a combo box for the product in the chosen shelf.

    And finally, make a selection from my 8 dercriptions in my combobox product.

    So, Shelf combobox for Products
    Product combobox for Description

    Example
    Shelf3, Product5, Description4
    Or Shelf3, Product5, Description2
    Or Shelf3, Product4, Description4
    Or Shelf1, Product4, Description2


    TonC

  5. #5
    VBAX Regular xps350's Avatar
    Joined
    Jul 2022
    Posts
    15
    Location
    I do not understand why a product has 8 descriptions. Can you explain and give examples?
    Groeten,

    Peter

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
  •