By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,519 Members | 2,295 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,519 IT Pros & Developers. It's quick & easy.

Refresh Listbox

P: 71
I've got a list box that has about 6-7 columns with information, pulled from a table. When you click on a row in the list box it displays all the information in a series of text boxes, so that the information can be edited. I've got an add and delete button, so you can select a row in the listbox, then delete it; or enter information in the listboxes, then click the add button and add the information to the table.

The buttons work fine with regard to making the changed so the table. Now I'm looking for a way to essentially refresh the listbox when the button is pressed to represent the new table information. I'm trying to use the .Requery method, but it doesn't seem to work.

Now, if I delete a line, then click on another line, it will show "#deleted" (or something to that effect) for each item in the row; but it won't clear it away. Any help for how to get the listbox to refresh would be greatly appreciated. Thank you in advanace.
Jul 16 '07 #1
Share this Question
Share on Google+
5 Replies


P: 71
Anyone have any thoughts on where I could start to look to figure this out?
Jul 17 '07 #2

Stang02GT
Expert 100+
P: 1,208
http://www.kayodeok.btinternet.co.uk/favorites/kbofficeaccesshowto.htm
http://www.accessmonster.com/
http://www.databasedev.co.uk/forms.html
http://www.mvps.org/access/



here are some very good access sites that will be able to help you out
Jul 17 '07 #3

JKing
Expert 100+
P: 1,206
Hi, I tested this out and Requery successfully removes the deleted rows for me.

Are you using .Requery for the form or the listbox itself? Perhaps you could post your code because there maybe something else that is wrong.
Jul 17 '07 #4

P: 71
Nevermind I'm dumb, after looking through this some more I realized I was putting the .Requery line in the wrong place in the code. I had accidentally placed it in the error handling section. I've got that working now.
Jul 31 '07 #5

JKing
Expert 100+
P: 1,206
Nevermind I'm dumb, after looking through this some more I realized I was putting the .Requery line in the wrong place in the code. I had accidentally placed it in the error handling section. I've got that working now.
Hehe, you're not dumb. It's a common mistake and happens even to the best of us. Just earlier today I spent over an hour trying to figure an error out to find I needed to move a statement one line up. Sometimes the most simple errors can be the most painful to solve.

Glad you resolved it though.

Jking
Jul 31 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.