Results 1 to 12 of 12
  1. #1
    Join Date
    Jan 2003
    Posts
    56

    Red face Unanswered: Stupid Question on Listboxes

    This is probably a really stupid question but does anyone know how to clear a selection in a listbox? Its driving me crazy fast.


    C.

  2. #2
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    what do you mean by clear a selection? can you explain what you are doing or what behavior you do not want?

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    something similar came up three days ago . maybe it's what you are looking for. http://dbforums.com/t838023.html

    izy

  4. #4
    Join Date
    Jan 2003
    Posts
    56
    Hi,

    I saw that post and tried to do the same thing but it does not change anything (the records in the listbox stay highlighted). I basically want to deselect these records by clicking a command button...

    Any suggestions as to why it will not work?!


    C.

  5. #5
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    I have not ried this because I am working on something else -

    But...

    Behind the a command button - requery the listbox refresh teh form and set the focus to another control

  6. #6
    Join Date
    Jan 2003
    Posts
    56
    Originally posted by axsprog
    I have not ried this because I am working on something else -

    But...

    Behind the a command button - requery the listbox refresh teh form and set the focus to another control

    Tried it but it still did not refresh the listbox - Thanks anyways.

    C.

  7. #7
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    when you say refresh - are you trying to remove the highlight or make the listbox empty, please explain - I am sure we can provide a profesional solution.

  8. #8
    Join Date
    Jan 2003
    Posts
    56
    Originally posted by axsprog
    when you say refresh - are you trying to remove the highlight or make the listbox empty, please explain - I am sure we can provide a profesional solution.
    I am trying to remove the highlights from the multi-selection listbox.
    Requery does not seem to work or typing lstSelect.Value = Null. They appear to work for others on the board but seem to have no effect on my form.

    The form is unbound with a listbox which displays all possible company records from the company table. It is multi-select, so I can select a number to print in a report. This part is working fine. The only thing I can't seem to resolve is the 'highlights' which I cannot get rid of - there are 234 companies so it would be a hassle if there were a lot of reports to print?!!!!

    C

  9. #9
    Join Date
    Jan 2003
    Posts
    56
    Thanks a million. I just found a solution from a previous post:

    http://dbforums.com/showthread.php?threadid=739740

    JDionne posted the following which works:

    "after your rutine to add a new vender reset the list box's recordsource

    listbox.recordsourcetype = "table/query"
    listbox.recordsource = "select * from vender_table"

    that will make it requery the table for its list. you can put this in the on change or wehre ever u have an action."

    Thanks again to everyone who posted reponses! Its after 6pm - I am off home!

    Cheers,

    C

  10. #10
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    try something like

    itemselected = listitem(0)

    resetting the listitem to 0 ---> listitem(0)

    should remove the highlight

    I have never done this but it sounds good in theory

    please let me know

    If you send a little sample db I might be able to return a solution today

    hth

  11. #11
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    my response earlier and I quote

    Behind the a command button - requery the listbox

    glad we could help

  12. #12
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Try:

    YourListBox.Value = Null

    That should be faster than requerying.

    blindman

Posting Permissions

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