Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / August 2005

Tip: Looking for answers? Try searching our database.

requery a listbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
george - 18 Aug 2005 08:54 GMT
Hi to all,

I have a form with a listbox on it. When there are items ALREADY showing I
can double click on any item, open programmaticaly another form, edit the
item and close the form. On the close event of this second form I have a
listbox.requery command. As soon as the form closes my listbox updates
immediately. But not always! When there are no items ALREADY showing in the
listbox and I open the second form through a command buton (not with the
DoubleClick Even of the list box), add multiple items and then close the
form, the listbox is still showing empty. If I close the form containing the
listbox and reopen it or if I move to a different record and then return back
THEN  the listbox is showing the newly added items and works as expected when
I edit them. Any clues how I can correct this behaviour?

thanks in advance, George
Graham Mandeno - 18 Aug 2005 10:35 GMT
Hi George

When you open the "edit item" form, you should open it in dialog mode, by
specifying the Windowmode argument as acDialog:
   DoCmd.OpenForm "MyForm", ... WindowMode := acDialog

This causes the procedure containing this line to be suspended until the
form is either hidden or closed.

Then, after the DoCmd.OpenForm, add:
   Me.[MyListbox].requery

This means the listbox will not be requeried untiol after the edit form is
closed.
Signature

Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

> Hi to all,
>
[quoted text clipped - 15 lines]
>
> thanks in advance, George
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.