Full Version: refresh or requery data on main form after delete on pop-up form
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
nanner
I have a main form - continuous - from which on each detail record the user can click a Form Operations command to open a pop-up form to do maintenance on the record. On the pop up form, I have a delete button. After the user deletes the record and is returned to the main form, I'd like there to be an automatic requery - thus getting rid of the deleted record - which still can be seen as 'deleted'. I've tried half a dozen events and can't seem to find the right one. Can anyone help?
Aquadevel
Nanner,

Try this in your AfterUpdate Event:

DoCmd.RunCommand acCmdRefreshPage

good luck, frown.gif

Aqua
nanner
Sorry, no - didn't work. Thanx just the same, though.
nanner
I should mention - on the main form, I have a command button that does run the requery for me - but I'd like to automate it after maintenance is done rather than have the user have to use the button.
HiTechCoach
Before your "pop up" form closes by adding this to the "On Close" Event:

Forms![MainFormName].Requery
Aquadevel
Nanner,

Have you tried putting the call to Me.Requery on the 'Close' of the pop-up?

I used that function on a delete button I have in a continious subform and it works ok here.

Aqua
nanner
Thanx, Boyd! That was the ticket!
nanner
Thanx to you too, Aqua!
HiTechCoach
You're welcome.

Glad we could assist you.

uarulez2.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.