using queries to delete

scratch

Registered User.
Local time
Today, 11:19
Joined
May 10, 2005
Messages
98
I hopefully will solve a major problem by deleting with a stored query. Right now a user selects records from a listbox and then deletes if need be. Here's my present code

Code:
    DoCmd.SetWarnings False
    DoCmd.OpenQuery "Query5"
   
    Me.lstClinic.Requery
     DoCmd.SetWarnings True

The delete works fine but when a user clicks on the listbox to select another record after the delete they get a message that says :

The data has been changed
Another user edited this record and saved the changes before you attempted to save your changes.
Re-edit the record.

This despite this being run off the desktop with no chance of another user to do anything. I guess it needs to be refreshed but .Requery doesn't work. Any suggestions?

scratch
 
I think that you also need to requery the forms record source.
 
Put in a
Me.Refresh
 

Users who are viewing this thread

Back
Top Bottom