listbox rowsource not requerying

G

Guest

I have a form which is opened from another form.

In the form open event I set the rowsource for the listbox - this works fine.

When you click on a button to edit details (opens another unbound form which
changes the original data) and return to the said form I cannot get the
listbox to requery. (except for closing and reopening). I use this technique
in other places with no problem.

Any ideas

Thanks

Adrian
 
A

Alex White MCDBA MCSE

Hi Adrian

So is lstMy.Requery is not working?

on the second form after you change the data (and saved it) have you tried
form_FrmMyOriginalform.lstMy.Requery ?
 
G

Guest

Many Thanks Alex

The latter does appear to work.

The former does not work on this particular form. Although as I mentioned
earlier, I use this technique elsewhere in the same database and it does
work. I've checked all properties of both comparable forms and both
comparable listboxes and there is no difference. Both forms are neither
popup nor modal although both are opened as "acDialog" as are the two forms
which add/edit data from the forms in question

I don't like to explicitly name a form like this if I can help it but it
looks like I shall have to in this case.

Kind Regards

Adrian
 
A

Alex White MCDBA MCSE

Hi Adrian,

try this then

forms![my form name with spaces].lstMy.Requery

by the way the example I gave you ...

form_FrmMyOriginalform.lstMy.Requery

means the forms name is FrmMyOriginalfor, call the form what you like it
should work.
 

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

Top