LISTBOX REQUERY

P

Paul Martin

Hi All,
I have a series of different forms containing a list box
which is used to open another form with the correct
record. Because of various search routines, the RowSource
for these listboxes are set programatically.
The problem I have is that when I close the related form
(and these are without exception unbound forms), a simple
requery does not work. This requery has been called from
the form.close event of the form being edited. It's fine
if I'm adding new records, but if I'm just editing the
record, the requery method just doesn't work.
I would be really grateful if anyone can make any
suggestions as to how I can overcome this issue.
Thanks & Regards,
Paul Martin
 
M

Michel Walsh

Hi,


Have you tried


With FORMS!FormName!ControlName
.RowSource = .RowSource
End With



Note that if your form FA is dirty, in an edit mode, then, technically, you
may have to save it before requerying it (else, you loose data already
entered). That is why it may be preferable to requery just the combo box row
source control.


Hoping it may help,
Vanderghast, Access MVP
 
?

=?ISO-8859-1?Q?=D8ystein_Sund?=

I solved this problem with entering dummy values that are bound to empty
posts (except from the cell with the primary key) that are saved. Just
set the standard value in the bound objects to be the ID of that empty post.

This may be a stupid solution and there should be better solutions. But
it works fine for me and it is an easy way to solve the problem.


-
Oystein Sund
 
P

Paul Martin

Hi,
Thanks for the suggestion, however, it hasn't worked. I
even tried changing the rowsource to a different query
before changing it back, but this didn't work either.
Thanks anyway, but if you do have any other suggestions I
would be keen to try them.
Kindest Regards,
Paul
 
P

Paul Martin

Hi,
Thanks to you for your suggestion. However, I have to be
honest and say I'm not clear about how to approach using
your suggestion.
If I understand correctly, you;re suggesting that I
create some dummy records that will be displayed, with
the hope that this clears the records I'm trying to
remove. Is this correct? If so, how do I then get rid of
the dummy records that I don't want? I'm sure I'm just
being stupid, but I would really appreciate clarification
as this problem has been dragging on for a few days now,
and I've been pulling my hair out with it!
Thanks again.
Paul
 

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