Results 1 to 5 of 5
  1. #1
    Pgill is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2011
    Posts
    21

    Listbox update

    Hi Guys,



    I have created a list box on my form that gives me a choice of equipment types. The list works great..... But if I need to add more equipment to the list (separate table) I have a button which when clicked opens a form to the equipment table where I can add the new equipment..... this works well.....
    But when I go back to my original form to use the listbox and choose the new equipment, it is still not there..... I have to close that form and then reopen it to refresh the list on the form......
    What I would like to know..... Is there a way to add equipment to my table through the add equipment button, and when I close the add equipment form... it updates the listbox on my form without having to close my form?

    Any help is appreciated,

    Peter

  2. #2
    Access_Blaster is offline User
    Windows XP Access 2010 32bit
    Join Date
    May 2010
    Posts
    339
    In the On close event of the 2nd form try Me.Requery

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    In the on close property of the form where you enter new equipment put in this

    forms!<formname1>!<listboxname>.requery

    where formname 1 is your primary form listboxname is the listbox where your equipment appears.

  4. #4
    Pgill is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2011
    Posts
    21
    Hi guys,

    Thanks for the help.... Rpeare, this is a carry on from my last topic..... In my test base, the detector type box I removed and added a Combo box that links to a table called Detector Type..... I also placed a button that runs a macro to open the form that links to Detector Type table..... This is where I add detector models..... When I have added the detector and closed the box, I click on my Combo dropdown box, and the new selection is not there.... But if I close the main form and reopen the form and the dropdown it is there......

    I have tried the me.requery that Access_Blaster told me and I have tried your, although not sure if the syntax is correct...... But anyway, still not working..... I have linked the code to the Click-on and the On-Focus, but also does not work..... Umm I am really battling..... If I get this one right..... my base will be complete as all my other repairs and mods have been done.....

    Table = Detector Type
    Form = Main (with dropdown and button) Dropdown = Combo181
    Add Detector Form = Detector Type (links to the Detector type table)

    If you can type out your command using what I have given you, I am sure it will help....

    Thanks again to both of you.....

    Peter

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    can you post a copy of your database please

Please reply to this thread with any new information or opinions.

Similar Threads

  1. ListBox RowSource Update Not working in 2003
    By Access0307 in forum Programming
    Replies: 1
    Last Post: 05-05-2011, 07:41 PM
  2. Update form when data collected from Listbox
    By Evetsllub in forum Forms
    Replies: 1
    Last Post: 06-10-2010, 05:33 PM
  3. Replies: 3
    Last Post: 04-14-2010, 10:00 AM
  4. Replies: 6
    Last Post: 03-27-2010, 11:18 AM
  5. Multi-select listbox and update flag in table
    By Suresh in forum Programming
    Replies: 0
    Last Post: 12-19-2007, 01:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums