ACCESS 2003 - HOW TO REFRESH/REQUERY THE QUERY IN SUBFORM AFTER RECORDS ARE DELETED

OceanStars
OceanStars used Ask the Experts™
on
USING VBA TO DELETE A RECORD ON A TABLE/QUERY BEING VIEWED IN A FORM, HOW CAN I REFRESH  (NAMES IN PARENTHESES) THE TABLE/QUERY WHILE THE USER IS STILL VIEWING IT IN THE FORMS' SUBFORM .....  HERE'S THE HIERARCHY  OF CONTROLS, ETC.
A QUERY (QRY_ASSIGNED)
...ON A  SUBFORM  (QRY_ASSIGNED_SUBFORM)
    ...THAT IS ON A PAGE (ASSIGNED)
        ...THAT IS ON  A TAB CONTROL (TABCTL_ACCOUNTS)
            ...THAT IS ON A FORM (FRM_ACCOUNTS)

 I HAVE 4 PAGES ON ONE TAB_CONTROL

WHEN THE USER ENTERS A CERTAIN VALUE IN A RECORD THRU THE EDITABLE QUERY, IT TRIGGERS THAT RECORD TO BE DELETED, AFTER REQUESTING A CONFIRMATION FROM THE USER.

I NEED TO QUICKLY REFRESH THE TABLE FOR THE USER SO THEY CAN CONTINUE THEIR WORK.   THEY WILL ONLY DELETE 1 OR 2 RECORDS PER SITTING.

THANK YOU SO MUCH

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012
Commented:
If the code deleting the records is in the parent form, then it would be:
Me![Assigned]![QRY_ASSIGNED_SUBFORM].Form.Requery
This is assuming that QRY_ASSIGNED_SUBFORM is the name of the subform *control* on the page and NOT the subform name.
 Place this after the delete code.
JimD.
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010
Commented:
I don't think you have to refer to the page, do you?  The way I do it in several of my apps is:

Me.[qry_Assigned_Subform].form.Requery

Dale

Author

Commented:
i thought i tried both of these options and got error msgs.  I have to work today/tonight and tmw and then i will test both again and award points.  thank  you.  i will let you know the results
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
i apologize for the delay.. new job is kicking me good... will come up for air this week and complete

Author

Commented:
Thank you
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:
<<new job is kicking me good... >>
No problem at all and good luck with the new job!
JimD.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial