Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004
    Location
    South Australia
    Posts
    39

    Talking Unanswered: Editing the contents of a ListBox

    Hi,

    I'm currently stuck on yet another database.

    My issue is that I wish to display a list of a particular student's interests - IT, Music, Drama, whatever.
    A listbox works fine for this, however I can find no way of modifying the list, as you cannot directly edit a listbox.

    Basically what I wish to do is display an editable list of all interests associated with that student.

    I currently have a combo box which displays a list of all interests currently entered. I would like to be able to select/type something here, and have a button create a new record of that interest, associated with the selected student's ID. This will effectively add that interest to the listbox.

    If anyone can think of an alternative way of achieving this, I'm open to suggestions.


    Thanks in advance,

    Frekster
    Last edited by frekster22; 01-06-05 at 02:25. Reason: Reworded question

  2. #2
    Join Date
    May 2004
    Location
    South Australia
    Posts
    39
    Ideas anyone?

  3. #3
    Join Date
    Sep 2003
    Posts
    41

    use requery

    This is kinda complicated since i dont have you form structure. but the simple way is a button to bring up a form that shows that students interests in datasheet view, add the new interest , close the form , and then have a button on the original form that can requery the list box.

    Basically make a button with it's on click event set to nameofyourlistbox.requery.


    Or on the form that just popped up put this code in the new forms on close event.
    [forms]![nameofyourformthathaslistboxonit]![nameoflistbox].requery

  4. #4
    Join Date
    Nov 2004
    Posts
    32
    Another user friendly way would be to put the requery on the OnFocus event of the combo box that shows the interest.

  5. #5
    Join Date
    May 2004
    Location
    South Australia
    Posts
    39

    More info

    Thanks guys for the suggestions. I have considered something similar (that is, using a seperate form), and it looks like I will end up using briley's suggestion.

    If possible, however, I would like to achieve this using only the one form. I'll live if this is not possible, but I always like the elegant solution

    As can be seen in the attached picture, this database will be used to keep track of students and their directions in life. The two boxes underneath the Areas of Interest heading are causing the problem. The list box shows those interests associated with the student, and the combo box gives a list of all previously entered interests. A button would be added to the right of the combo box.

    Can anyone think of a way to achieve my goal of adding one to the other without opening another form? Otherwise I'll stick with briley's idea.


    Cheers,
    Frekster
    Attached Thumbnails Attached Thumbnails Database Pic.GIF  

Posting Permissions

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