Results 1 to 10 of 10
  1. #1
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    transfer choices from one select box to another. (2003)

    I am wanting to design an interface where I can choose values in one list box and transfer to another box and run a report off those selections. I can't remember where I saw the design of this but I see this on websites often. What would be the best way to approach this?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: transfer choices from one select box to another. (2003)

    This is usually referred to as a "pick list" form and you can search on that phrase to find multiple threads on the topics, including examples. <post:=204,214>post 204,214</post:> might get you started.
    Charlotte

  3. #3
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: transfer choices from one select box to anothe

    Do you mind if I use the code that you have used?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: transfer choices from one select box to anothe

    Code posted or attached in the Lounge is free for everyone to use and/or modify.
    If you wish, you can include a comment in your code to acknowledge Charlotte & Woody's Lounge. But it's not obligatory.

  5. #5
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: transfer choices from one select box to anothe

    I have attched the database and there seems to be a problem. Sometimes when I add it will add and sometimes I have to double click to add in the FrmReport. I am using this menu for selection and then base my query off these selections. I will probably add 2 more options such as type of product and type of service - inpatient or outpatient. Also, will there be a problem running a query based on those facilties that are added?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: transfer choices from one select box to anothe

    The lstSelected list box has 4 columns (Column Count = 4). Your code adds two columns from the lstSelectFrom list box to the row source of lstSelected. So first, you add coulumns 1 and 2, next time you add columns 3 and 4 (but since they have column width 0, you don't see them), next time, you add columns 1 and 2 in the next row, etc.

    You should have a unique identifier, preferably the primary key of the table, in the first, hidden column of both list boxes. You can then use this identifier in further operations.
    Your table doesn't have a primary key, unfortunately.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: transfer choices from one select box to anothe

    Here is a modified version of your database. I adjusted the column count for the list boxes, and adapted the code for your situation. Since the first list box has a query as row source, there is no point in modifying it in the code. And the code to remove items from the second list box didn't work correctly.

  8. #8
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: transfer choices from one select box to anothe

    Thanks for your help on that. Once I move the facility to the list box below ,is it possible to make a query to reference that choice and then have those choices appear in the report I want to design? Would that be very complex?

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: transfer choices from one select box to anothe

    As it is, the list box is fairly useless. There is no unique key to identify records, and nothing prohibits the user from adding the same record twice. The former is a fundamental flaw of your table.

  10. #10
    2 Star Lounger
    Join Date
    Jun 2005
    Location
    Atlanta, Georgia, USA
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: transfer choices from one select box to anothe

    I might try a different way because the whole process is a tad convoluted. I am taking a download from our facility pricing system each month and trying to make a database where they can view the contracts from the facilitites since there is no reporting module from our facility pricing.

Posting Permissions

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