?
Solved

MS Access 2003 refresh form on popup form close

Posted on 2012-12-20
3
Medium Priority
?
706 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 earned 2000 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
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
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.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
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…
Suggested Courses

752 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