Results 1 to 4 of 4

Thread: Listbox Traumas

  1. #1
    Join Date
    Feb 2002
    Posts
    55

    Unhappy Unanswered: Listbox Traumas

    First off, I never use listboxes and I remember why.

    Anyhow, I have a form with a listbox field (RecordType) of multiple choices.

    E.G.- Choice #1
    Choice #2
    Choice #3

    I want to be able to make multiple selections, but as this is a bound field, I have no idea how to store the information for later retrevial (let alone how to go about retreiving it).

    I figured out how to select more than one choice, I am just not certain how to store the multiple values in the table.

    Is there anybody out there with an easy to understand explanation of how this is done with Access 2K?

    TIA...

  2. #2
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Listbox Traumas

    Originally posted by hirkos
    First off, I never use listboxes and I remember why.

    Anyhow, I have a form with a listbox field (RecordType) of multiple choices.

    E.G.- Choice #1
    Choice #2
    Choice #3

    I want to be able to make multiple selections, but as this is a bound field, I have no idea how to store the information for later retrevial (let alone how to go about retreiving it).

    I figured out how to select more than one choice, I am just not certain how to store the multiple values in the table.

    Is there anybody out there with an easy to understand explanation of how this is done with Access 2K?

    TIA...
    The way that I do it is that I write a little bit of code that updates each selection into a field. Each selection will become a row of data in its table. So if 2 selections were made, then two records would have to be created.

    Could you outline your tables and design involved in this and I might be able to write some code to do it.

    Cheers
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

  3. #3
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    You have a couple of options.

    You can use the multiselect property of the listbox and use the itemselected property

    or ( I had to use this on a A97 app)

    You could use the OnDoubleClick event of the listbox to populate a temporary table for using the selections.

  4. #4
    Join Date
    Oct 2003
    Location
    London
    Posts
    341
    Hi guys.

    I'm trying to solve a query of my own and it seems to be similar to this. I'm afraid that I've been reading pages and pages of text and webpages and forums I've lost all attention to detail now.

    I have a table called Tbl_Trainer and a Table called Tbl_Course.

    Currently this is set up in a one to many relationship with each course allowing only one trainer. Thats where I messed up as I now need to select multiple trainers for a course. I.e. the course "leadership" must have 3 trainers.

    Tbl_Course has an autonumber "CourseID" assigned and another table called Tbl_Merit is linked to Tbl_Course via CourseID.

    Is there anyway that your above solution or does anyone know of any other way that I can get this to work?

    If I read the above correctly, your suggestion above would like this when displaying two courses, each with two trainers?

    CourseID Date Trainer
    1 03/07/06 Elektra
    2 03/07/06 DareDevil
    3 04/05/05 Scooby
    4 04/05/05 Shaggy

    This won't work as I need to report on the merit assigned to a course id. Doing this would mean that Course 1 would have a merit against it but Course2 wouldn't.

    The only other I can think of would be to create a placement table between the two but does anyone have any comments about this method? I don't want to waste my time creating this to find that it doesn't work.

    Thanks for your time.

    Christy

Posting Permissions

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