Error 2118

G

Guest

Hi,

I have a form in Access 2003, that is bound to a table. On this form I have
a couple of listboxes that are there to just display data. They are not bound
controls although their source is an SQL statement that includes the primary
key value from the currently displayed record in a WHERE clause. The user can
select a row in the listbox to open up another form displaying more detailed
information about the data in that row.

I also have a timer event attached to the form, set to 'fire' every two
seconds to update these two listboxes. The problem I have is that more often
than not the requery causes the following error,


--------------------------------------------------------------------------------
2118: You must save the current field before you run the Requery action.

--------------------------------------------------------------------------------

I've seen suggestions to use code such as 'Me.listbox_name.UNDO' to solve
the problem but I have tried this and found that the values of other controls
on the form are cleared at the same time. I can't save the form either
because at this point the user might not have enter values in all the fields
and therefore the data integrity checking would kick in.

If anyone has any other suggestions I'd be most grateful!

Thanks in advance,
Ben
 
R

Rob Oldfield

Whatever the problem is, it certainly won't be helped by using a Timer event
to control refreshes. That's just wrong. Try OnCurrent instead. Set row
sources in there and I don't think you'll even need a requery.
 

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