'#Deleted' shows in list box

captgnvr

EAGER LEARNER
Local time
Today, 05:15
Joined
Apr 27, 2010
Messages
144
D/all

I have a list box in a "info_form" to multi select names to get their particulars.

Once a person leaves, his record is deleted using another form for deletion.

When I come back to "info_form" I see in the list box "#deleted" for deleted records.

If I go to the row source type and run the query using the ellipses then the '#deleted" goes off.

Can you pls tell me how to remove this from the list box, after i delete a record in another form?
 
Requery the listbox after you think that the records displayed in it have changed in any way that may affect what is displayed or whether records have been deleted or added.

Syntax is

YourListboxName.Requery
 
Thank you and it works. I use it in the vb where i delete. But could you tell me where will it be best to put that 'requery' vb line. or Do I have to put at the end of the module where I add records and also at the end of the module where I delete records?

Can I put it in the listbox form itself?? 'on open' and 'on close' to requery??
 
D/Highandwild

Thank you very much for the guidance. I put a command button on the list box form itself and click it when I want to requery.
 
I'm not sure what you form set up is but do not have a button.

Is the code that adds and deletes records in the code module of the same form as the listbox is on. If so then at the end of the procedure that adds / deletes then requery the listbox.

It will always be up to date then .
 
Negative. the list box in one form and the deleting is another record. However got it sir and will do as guided. I will do some alterations and get the deleting in the same listbox but will keep adding record in different form. thank you for the help.
 
You can requery the listbox from the form that you are deleting and adding records.

In the procedure that you delete or add the records do something like this:

Dim frm As Form

Your Code here

Set frm = Forms("YourFormName")
frm.ListBoxName.Requery

I'm off to bed now (UK) so you are on your own now.
 
lol. Good night sir. Got all I want for today. Thank you. My ship in Kerch-black sea.
 

Users who are viewing this thread

Back
Top Bottom