Solved

MS Access 2003 refresh form on popup form close

Posted on 2012-12-20
3
702 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 48

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 48

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

695 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