Results 1 to 4 of 4
  1. #1
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419

    Passing list box selection from 1 form to another

    Hello,



    So I created two list box in a form. It allows users to select two items from two separate list box and then they click on a button after the selection and it goes to another form.

    I want the other form to use the items selected from the first form. How do I pass these variables or items to the second form ?

    Please advise !

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    depends.
    Is the first form still open? You can reference the selecteditems property from each listbox in the 2nd form's code. This would be the easiest.
    Not open? pass the items as comma separated values in a string by using the OpenArgs parameter of the Docmd.OpenForm method. Now you have to separate them in the code of the second form - not so easy for you.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Thanks Micron, I have done it the OpenArgs way even with the previous form still open. But is limited in the number of variables it can carry over.

    The 1st form is still open.
    I will do it with the selected item method, which is forms.form.list.column.

    Thanks for your advise and suggestion.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    But is limited in the number of variables it can carry over.
    For multiple items, you'd use a variable. The maximum character length for a string variable is huge, although it might be limited in certain ways of using it.

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

Similar Threads

  1. Replies: 3
    Last Post: 08-20-2017, 02:58 PM
  2. List box on bound form shows no selection
    By warmslime in forum Forms
    Replies: 3
    Last Post: 03-04-2017, 09:10 AM
  3. Replies: 6
    Last Post: 09-06-2016, 02:46 PM
  4. Replies: 12
    Last Post: 03-27-2014, 06:14 AM
  5. Passing Multiple selection values to a report
    By techexpressinc in forum Forms
    Replies: 7
    Last Post: 01-13-2012, 02:27 PM

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