refresh listbox from another form

  • Thread starter Thread starter xbound
  • Start date Start date
X

xbound

On form1 I have an unbound list control whose source is from a query. Is
there any way to activate a refresh of that list with something like
list1.requery from a form2? Thanks.
 
Yes but usually, you must use the global forms collection, something like:

Forms![NameOfTheForm]![NameOfTheControl].requery

The [...] are optional if there is no blank space or strange character in
the name. If the control is on a subform, you must access the Form property
of the control:

Forms![NameOfTheForm]![NameOfThe_SubForm_Control].Form![NameOfTheControl].requery

Notice the difference between the use of the dot . and of the bang !
operators. The bang operator is used for collections of properties that can
vary from Form to Form because you define them while the dot is for static
properties; ie., the properties that are always there. If you use the dot
in place of the bang operator, Access will usually still find the correct
control because it will look everywhere.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Blog/web site: http://coding-paparazzi.sylvainlafontaine.com
Independent consultant and remote programming for Access and SQL-Server
(French)
 
Back
Top