refresh listbox from another form


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.
 
Ad

Advertisements

S

Sylvain Lafontaine

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ADP Form Refresh 2
Refresh a view from code 0
Listbox Rowsource 0
ADO and listboxes 6
Listbox-problem 2
data refresh 0
refreshing objects 1
Refreshing sub Form after executing a stored Proc. 11

Top