Solved

MS Access 2003 refresh form on popup form close

Posted on 2012-12-20
3
689 Views
Last Modified: 2012-12-21
My attacjed code looks right.

It opens my popup which I ender some data etc and then close.

However...the underlying form doesn't get refreshed.

Private Sub btnSubmit_Click()
    DoCmd.OpenForm "ClientVisitsPopUp", WindowMode:=acDialog, OpenArgs:=Me.lvClientsNearby.Column(2) & "|" & gbl_VisitClientID & "|" & gbl_NearbyClientID & "|" & Me.gbl_VisitID
    Me.refresh
End Sub

Open in new window

0
Comment
Question by:lrbrister
  • 2
3 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 38711131
Given your code, I assume you have a button on the "ClientVisitsPopUp" that writes the data to your underlying table, and then closes the form (or hides) it.

However, if you are adding to the table, you need to use:

me.Requery

instead of:

me.Refresh

The Refresh method will update data that has been changed in the forms current recordset, but will not display additions to the recordset that have been since the form was opened.  In order to reflect changes due to additions or deletions, you must use the Requery method.
0
 

Author Closing Comment

by:lrbrister
ID: 38713802
Thanks
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38713861
You might also want to capture the primary key from the record you added, and after the Requery method, use the FindFirst method to move the record pointer to that record.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now