Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating a list box

Status
Not open for further replies.

Jackvmae

Programmer
Feb 18, 2004
17
0
0
US
I highlight a record in a listbox, and then I use DAO to delete the record from the table. My code then goes on to requery the list box to make the deleted record disappear from the list box.

Only problem is, that record does not disappear. If I place a cmdButton on the form to requery the list box again, only then does the deleted record disappear.

I guess that Access takes some time to update the table, so the list box is getting requeried before the table has a chance to delete the record.

Any ideas how I can make this code work right?

Thanks,
Jack
 
Try me.recalc or if this doesn't work hide your command button and call the command button proc when you need it to update. If the command button is named Button1 then the code would be Button1_Click.
 
Let me explain a bit further...

What I wish to do is have my code use DAO to delete the record from the table (this part is working fine) and then have the code go on to requery my list box so that the deleted record is no longer in the list box.

The problem is that the list box get requeried, but the deleted record is still there. It's like the list box is getting requeried before the table has a chance to delete the record.

Hope I am making sense. How do I fix that code so that the table has a chance to delete the record before the list box gets requeried?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top