Results 1 to 9 of 9
  1. #1
    GirlGeek is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    3

    For Mr. P Baldy

    I recently was able to incorporate one of your solutions to a complex problem I was having with a database.



    http://www.baldyweb.com/MultiselectAppend.htm

    THANK YOU!

    I would LOVE to use this same solution for another database but need the ability to select a record and add a numerical quantity to it, as well. How might I adapt your solution to this type of problem?

    THANKS in advance.

    GG
    Last edited by RuralGuy; 05-16-2011 at 12:14 PM. Reason: Baldy's 1st name is Paul :D

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Glad it helped! I'm not clear on the quantity. A quantity field could be the "OtherValue" demonstrated in the sample, or another one. Or are you saying if you put 5 there, 5 records would be created? One way would be a For/Next loop that used that textbox for the upper limit.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    GirlGeek is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    3
    Thanks for editing, Rural Guy! I'm brand new to the forum.

    Mr. B: I guess I was hoping that I could have a select subform with two columns... one with the name to select (Reject Type) and another to add the qty of rejects. I will consider the OTHER table. I hadn't because, in my mind, the OTHER table was already "used up" by something else I had in mind.

  4. #4
    GirlGeek is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    3
    Yeah, that won't work. I need a value for each thing I select.

    What I need is this:

    A main table to input data for the manufacture of a FINISHED GOOD (Item, Qty, etc.).
    A subtable to input data for the number of REJECTS each build of finished goods produced.

    What I have right now works but I am completely unable to prevent the end user from duplicating the entry of Finished Goods because, conceivably, they could build two sets of exactly the same item, quantity, etc.... on the same day.

    I thought, perhaps, I would change the table structure altogether, using your selection list... but maybe I can't.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'm probably have a brain cramp, but I'm not visualizing what you're trying to do. Perhaps you can post the db, or what you expect to enter on a form and what you'd want to go into a table?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    NubiBlue is offline Novice
    Windows Vista Access 2003
    Join Date
    May 2013
    Posts
    2
    Hi Paul,

    I've just come across your multi-select example from your website. It is perhaps one of the few that I can really understand, but like the last post, I'd like some assistance in how to modify it. I would like to create a multi-select listbox where I can save the following information to a table. The client ID that matches all the selected items from the multi-select listbox. Not just the ID number. Is that possible? Are you able to provide some guidance in how this can be done?

    The completed table would look something like this;

    ID List Box Item
    2 Chocolate
    2 Milk
    2 Fruit Juice
    3 Chocolate
    4 Milk
    4 Chocolate

    Thank you in advance.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I must still be having brain cramps, because the example already takes a value from the listbox (your items) plus one from a textbox (your ID?) and appends them.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    NubiBlue is offline Novice
    Windows Vista Access 2003
    Join Date
    May 2013
    Posts
    2
    Quote Originally Posted by pbaldy View Post
    I must still be having brain cramps, because the example already takes a value from the listbox (your items) plus one from a textbox (your ID?) and appends them.
    I'm really sorry for your 'brain cramp'. It must be related to the way I've explained myself. Yes, your example does indeed take a value, but both are numeric value. When I've tried the same trick using EmplLName in the loop instead of EmpID, it still returns a numeric value. I want something that returns a string from the selected items in the list box, as well as an integer for the EmpID. I hope that makes sense which is why my example is written thus;

    ID (Numeric) List Box Item (String, text)
    2 Chocolate
    2 Milk
    2 Fruit Juice
    3 Chocolate
    4 Milk
    4 Chocolate

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Normally we store numeric ID's rather than the text, but if you need to use a different column of the listbox than the bound one, you'd replace

    ctl.ItemData(varItem)

    with

    ctl.Column(x, varItem)

    replacing x with the column number you want.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

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