Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    Unanswered: Listbox to Another Form

    Okay to all of those who have been helping me with this list box thing. I need help with one last aspect. Taking all of the values of my bottom list box and opening a form and populating a subform with it.

    Here is the code in the button so far...

    Code:
    Private Sub cmdCSO_Click()
        DoCmd.OpenForm "SalesOrder"
        'Need code to highlight all items in Bottom listbox
        'and to input them into the subform of the SalesOrder form.
    End Sub
    Thanks again for everything,
    JS
    Attached Thumbnails Attached Thumbnails searchform.jpg  
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Use the same basic iterative function to scroll through eachitem in the listbox and add them to your subform one record at a time.

  3. #3
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Okay I thought it would be something similar. I am going to give it a shot.


    will post again for help I am sure but ya never know.

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  4. #4
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Okay one thing I need to know is how to get it to select the whole list not the one that is selected, or get it to select all before it runs through the loop.

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  5. #5
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by Teddy
    Use the same basic iterative function to scroll through eachitem in the listbox and add them to your subform one record at a time.
    OR ... If you have a table, then merely have your subform query for those items ... Heck, you could even "dynamically" bind your subform to that table ...

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    None of the above.

    You can't select the entire source for the listbox if it's set to a value list, you need to scroll through each item and append the records one at a time. Alternately you could dump them into a temporary dataset or an array, but that's an unnecessary step.

  7. #7
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Originally posted by M Owen
    OR ... If you have a table, then merely have your subform query for those items ... Heck, you could even "dynamically" bind your subform to that table ...
    My understanding is the source listbox is not based on a table.

  8. #8
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    hehe M Owen. I read through your code but I couldnt quite decipher it for my use. I am just barely past a beginner with VBA


    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  9. #9
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by Teddy
    My understanding is the source listbox is not based on a table.
    ... And I haven't been keeping up on the progress either ... I don't know which way JS is doing this ... I have a fear that he may be scrapping the value list method if the parts list gets too big ... That's why I suggested the table way ...

  10. #10
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    yes the List box is a Value list. How would I make it search through the values even if they arent selected?

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  11. #11
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by JSThePatriot
    hehe M Owen. I read through your code but I couldnt quite decipher it for my use. I am just barely past a beginner with VBA


    JS
    What don't you understand about it? You can PM me with explicit questions ... Like: Why I did what I did ...

  12. #12
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    I think the Value List will be fine. I dont think there would ever be more than one hundred different part numbers for one order. If there is I will cross that down the road when if everything goes at this rate I will know alot more about VBA .

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  13. #13
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Originally posted by M Owen
    ... And I haven't been keeping up on the progress either ... I don't know which way JS is doing this ... I have a fear that he may be scrapping the value list method if the parts list gets too big ... That's why I suggested the table way ...
    That was an interesting method, one that I've used in my own PERSONAL projects. The issue comes when multiple users are running the app at the same time.

    If you get two or three people monkeying around with that boolean field flag at the same time, things get hosed pretty quick.

  14. #14
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by JSThePatriot
    yes the List box is a Value list. How would I make it search through the values even if they arent selected?

    JS
    You'll have to do Teddy's method ... Iterate thru the ItemsSelected method ...

  15. #15
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Oh crap really? DANG hehe I have about 5 users and only two of them maybe 3 would be using the sales order and not neccisarrily at the same time.

    Would that still make it hairy?

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

Posting Permissions

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