Complex update with check boxes

Discussion in 'C#' started by devmonk, Sep 27, 2006.

  1. #1
    I need to create an administrative page to update a table and make it as simple for the end users as possible but I am having a terrible time figuring out how to do it. Here is the situation...

    I need to allow the end user to update which products are carried by which warehouses. Both products and warehouses are stored in their respective tables with a table used to associate one with another.

    The MS Access tables are as follows:

    wtbProducts table contains fields productID and Alias (the name of product)

    wtbWarehouses table contains fields WarehouseID and Alias (the name of the warehouse)

    wtbProductWarehouses table contains fields productID and warehouseID

    I have a page set up so that the user can select a specific warehouse and the warehouseID will be passed as a querystring to the second page. On this second page I want all of the products displayed with checkboxes. If the productID/warehouseID combination is found in the wtbProductWarehouses table I want the check box to be checked. Odviously then the user will check/uncheck which products are shipped to which warehouses so I will then need to update the wtbProductWarehouses table accordingly.

    This process is absoultly killing me. If anyone can help me out I would greatly appriciate it. Thanks!
     
    devmonk, Sep 27, 2006 IP
  2. Froggie

    Froggie Well-Known Member

    Messages:
    665
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    120
    #2
    you going to have to help us out a little bit providing more information.
    so I will give you a starting point

    1. construct a recordset that will retrieve all the products
    2. construct another recordset that will retrieve all the products for a specific warehouse.
    3.loop through the first recordset and for each product dynamically create a checkbox, within this loop, loop through the second recordset looking for this product to see if it exists, if it does set the checked property/value to on.
     
    Froggie, Sep 28, 2006 IP