Remove list box item without requery (Access 2000)

J

Jim D.

I have searched the knowledgebase and this forum and can't find an answer to
this. Is there a way to remove a list box item (a record that is displayed)
without requerying? For example, I have a list of records showing in the
list box; the app allows a user to higlight one or more records in the list
and then click on a command button which deletes the records in the database
(SQL Server 2000). Requerying the list takes quite a long time, so I would
like the application to simply remove the records from the list if no error
was returned by the database after the deletes.

The list box is unbound and is populated using a "call-back" function as
described in the Access 2000 handbook and in the MS KB. Not sure that this
matters, but thought I should mention it.

Thanks for the help!
 
M

Mingqing Cheng [MSFT]

Hi,

Thanks for your post.

From your descriptions, I understood you would like to delete selected
record in list box control withour requery it. Have I understood you?
Correct me if I was wrong.

Unfortuantely, I am afraid requery is inevitable, it must take a long time
to requery the updated list. In KB Article:132026, we could find the
descriptions like this

This technique is not useful for large lists (more than 1000 items),
because it would take too long to requery the list.

Thank you for your patience and corperation. If you have any questions or
concerns, don't hesitate to let me know. We are here to be of assistance!


Sincerely yours,

Mingqing Cheng

Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
 
J

Jim D.

Mingqing,

Thank you for your reply. Yes, I found that KB article too and was hoping
that there was some other way to do this sort of thing.

Jim D.
 
M

MacDermott

If the table your listbox is based on is appropriately indexed, this can
speed up the requery considerably.
 

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