Results 1 to 6 of 6

Thread: List box update

  1. #1
    Join Date
    Sep 2002
    Location
    Ann Arbor, MI
    Posts
    47

    Question Unanswered: List box update

    I have a list box that pulls data from a Table TblVendors. When not in list, a form pops up to add a new vendor. when you close the add vendor form and try to add the new vendor it is not in the list. I have tried to use the requery method for the listbox on the GotFocus event for the form, but it still doesn't seem to refresh. Any suggestions?

    Thanks

  2. #2
    Join Date
    Dec 2001
    Posts
    79
    Try a listbox requery, or a form requery from your form's OnActivate event procedure.

    Hope this helps,
    Peter De Baets
    Peter's Software - Microsoft Access Tools for Developers
    http://www.peterssoftware.com

  3. #3
    Join Date
    Apr 2003
    Posts
    21
    To my knowledge, using just Requry alone won't help, after using Requery, try reassigning the recordset to the datasource property of the list box (use requery beofore that of course).

    rs.Requery
    lstBo.DataSource = rs

  4. #4
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    Originally posted by waleedfi
    To my knowledge, using just Requry alone won't help, after using Requery, try reassigning the recordset to the datasource property of the list box (use requery beofore that of course).

    rs.Requery
    lstBo.DataSource = rs
    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.
    regards Jim

  5. #5
    Join Date
    Apr 2003
    Posts
    21
    http://support.microsoft.com/default...;en-us;q191457 [PRB: DataEnvironment Recordset Requery Does Not Refresh Controls]
    Microsoft Knowledge Base Article - 191457
    Check this out

  6. #6
    Join Date
    Sep 2002
    Location
    Ann Arbor, MI
    Posts
    47
    Originally posted by JDionne
    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.
    regards Jim
    My goof - it's a ComboBox - not a list box. I was able to use rowsourcetype and rowsource propeties to do the same thing as you suggested. It works, but still with a problem.
    -If I add a Vendor to the ComboBox - say "xx1" - it pops me to my add vendor form.
    -I add the Vendor "xx1", close form to return to my combo box, try to TAB to the next field, and it still "says not in list" and pops me to my "add vendors form" again.
    The vendor is in my combo box when I pull it down. I can select the same xx1 from the list, but it just won't accept the new vendor as i 1st typed it, and as it remains when I return from the Add Vendors form.

    Thanks for your time

Posting Permissions

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