Click to See Complete Forum and Search --> : Requey list box on main form to show newly added data


mpoincare
July 7th, 2005, 09:22 AM
I have a listbox on a main form in MS Access 2000 named 'frmMain' that shows information based on table named "contacts". There is on this form a button that triggers an onclick event that opens an other form name 'frmContact' that allows to input a new contact. What I want now is for the new contact to be shown in the listbox on the form 'frmMain'. After the instruction on the form 'frmContact' that adds the new contact, I used the instruction: Forms!frmMain!lstContact.Requery. But the new contact entered is not showing on the list. Right after this instruction, I used the instruction: Forms!frmMain.Refresh. And still the new contact entered is not showing. Does anybody have any clue why the new contact entered is not showing on the listbox on 'frmMain'?

Chris_Student
July 7th, 2005, 10:07 AM
The first thing to check is to see if the record is actually getting put into the database. Is it?

Shuja Ali
July 7th, 2005, 10:26 AM
Requerying the List Box will not help..
You need to Requery the Recordset with which the Listboc is bound.. Also if it is not bound to any recordset then you need to reload the Recordset and then Load the Values again..

PS: It will b better if you could show us how do you populate the data in to the Listbox, then people can give a more precise solution.