Results 1 to 2 of 2
  1. #1
    ljw1115 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    1

    Query based Listbox on same form based on different Query

    I have a form that is based on a query (tblProjects & tblProjectsContacts). I have a listbox on the same form with a button to add equipment to the project. The listbox's query is based on tblProjects & tblProjectsEquipment. This opens another form (frmProjectEquipmentSearch) to select Manufacturer and Model in a seperate listbox (based on a different table). When you double click the list, it opens another form (frmEquipment) where you can add detailed information for that project equipment (ie. install date, warranty date, etc.). When you click the add equipment it populates the list on the original form (frmProjects). I can get the list of ALL equipment, but when I change to the next Project the list does not change.

    I have searched for a fix and I have seen the solution to add the criteria to the ID = forms!frmName!ControlName and add a requery to the forms current event but this doesn't work. When I add criteria I get a msgbox asking for the forms!frmName!ID.

    Note: The Projects.ProjectID was not populated when adding new equipment. I had to pass the Projects.ProjectsID from frmProjects to frmProjectEquipmentSearch to frmEquipment just to set ProjectEquipment.ProjectID=Projects.ProjectID.



    Does anyone know a solution in access or vb code I can enter??

    Thanks for your help in advance,
    Linda

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If the listbox is based on a query that changes as you select other times you have to refresh the contents with something like

    me.<listboxname>.requery

    or

    <listboxname>.requery

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

Similar Threads

  1. Report From Form Based Query
    By cartotech81 in forum Reports
    Replies: 1
    Last Post: 02-16-2011, 06:33 PM
  2. Query based form not working
    By Tewhano in forum Queries
    Replies: 1
    Last Post: 10-22-2010, 08:30 AM
  3. list box on a form based on query
    By nykedel in forum Forms
    Replies: 0
    Last Post: 06-15-2010, 01:12 PM
  4. Form Based Query/Filter
    By Micon in forum Access
    Replies: 0
    Last Post: 11-07-2008, 09:25 AM
  5. Run a PivotChart form based on query
    By Suzan in forum Queries
    Replies: 0
    Last Post: 06-11-2006, 03:48 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