Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2003
    Location
    Wetaskiwin, Ab, Ca
    Posts
    16

    Question Unanswered: multiply entries in a table created by single entry on a form?

    What I have is a small form that basicly looks like this :

    Product : <product entry>
    Date Recieved : <date entry - automaticaly entered>
    Number of pallets : <number of pallets entry>

    Add Product <button>


    What I need to be able to do is have some code enter the entries for "Product" and "Date Recieved" in an existing table (which has more fields than just these) x number of times dictated by the number in the "Number of pallets" entry.

    Is this possible and could someone point me in the right direction to make it work?

    Thanks,
    Kevin Johnson

  2. #2
    Join Date
    Sep 2003
    Location
    UK
    Posts
    122
    if you can calculate this information you don't need to store it. All you seem to be doing to useing up diskspace for no real end. Unless I have missed something you may need to reconsider the way you want to record the data.

    Remember a database is the Base of data from which you get information.
    Matt the Hat says: "what!?"
    A child of five could understand this! Fetch me a child of five!
    SCARY HARD CHALLENGE: http://www.dbforums.com/showthread.php?threadid=988682

  3. #3
    Join Date
    Sep 2003
    Location
    Wetaskiwin, Ab, Ca
    Posts
    16
    It isn't really a calculation. What it is for is in our production facility, when we recieve batches of raw materials, we need to be able to track each individual pallet or drum from coming into the plant to the material being used and the container disposed of.

    When we get materials in, it is somewhat large quantities and the shipper/reciever doesn't have the time to enter them all in. What I want to be able to do is have a form or some data entry page where the S/R enters something like " recieved 35 drums of chemicalAQ " and have 35 entries of chemicalAQ produced in the table as well as the date recieved and a unique idetifier or barcode for internal use. I can create the unique identifier, but not the multiple entries withour the S/R entering each one.

    I guess if worse comes to worse, I could just make her click an add to inventory button as many times as needed to get the information in, but I would like to stay away from that if possible.

  4. #4
    Join Date
    Sep 2003
    Location
    UK
    Posts
    122
    So what you have is say 35 instances of a common object/entity.

    I would do this

    Table: Common objects
    PK: ID (Autonumber)
    F2: Name - (ie ChemicalAQ)
    F3: Detail2

    etc

    Table2: Instances
    PK: ID (Atuonumber)
    FK: CommonObjectsID
    F3: Date
    F4: Delived By
    F5: etc

    You still only need to record unique data. Now you would only need to record the date which is the date the record is created? If so set the default value to Now()

    When you press the "OK" button:
    DoCmd.Open form "ThatFormForTable2"

    On ThatForm....

    On_Load
    Dim NumberOfRecs
    Dim CounterA

    For CounterA = 1 to NumberOfRecs
    DoCmd.GoToRecord , , acNewRec
    TXTDevBy.Text = DeliveryPerson
    etc
    Next CounterA

    Of caurse you will need to pass some information to the form but has this cleared things up for you?

    The only reason you would want to record 25 records is if later unique information gets intered for it like who it got sent to etc.

    From my understanding you will need a very object oriented data structure design. Good Luck
    Matt the Hat says: "what!?"
    A child of five could understand this! Fetch me a child of five!
    SCARY HARD CHALLENGE: http://www.dbforums.com/showthread.php?threadid=988682

  5. #5
    Join Date
    Sep 2003
    Location
    Wetaskiwin, Ab, Ca
    Posts
    16

    Thumbs up

    "You Da Man"

    That was exactly what I needed. Thanks

  6. #6
    Join Date
    Sep 2003
    Location
    UK
    Posts
    122
    Pleased to have helped

    BTW:

    You could have three tables for 0 repitition

    T1: Generic things
    T2: Examples (Palets)
    T3: Object On Pallet

    This is nearer 3rd Normal Form

    [T1]-<[T2]-<[T3]

    You would need to run a SUM Query each time a T3 was created (to log removle from wearhouse etc) and skip the creation should SUM(Foo) => Total(Foo) in T2.

    But I get the impression you would be happier with the current plan.
    Matt the Hat says: "what!?"
    A child of five could understand this! Fetch me a child of five!
    SCARY HARD CHALLENGE: http://www.dbforums.com/showthread.php?threadid=988682

  7. #7
    Join Date
    Sep 2003
    Location
    Wetaskiwin, Ab, Ca
    Posts
    16
    You are correct, your original solution gives the exact setup that the boss wants to see internally. Thanks for the alternate solution as well.

    Kevin Johnson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •