Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Display updated table through a subform

Posted on 2016-11-04
4
Medium Priority
?
42 Views
Last Modified: 2016-11-04
I have an Access form with a subform on it whose records source is a table.  The table's contents get displayed in the subform.

I have a query that updates the table displayed in the subform. Actually what the query does is  adds records to or appends the table.

The query gets invoked by clicking a command button.

After I run the query, how do I get the updated table to display in the subform?

I think it's something like Docmd.Requery but if that's what it is, where do I put it? Or if it's something else entirely, please let me know.

Thanks
0
Comment
Question by:dbfromnewjersey
  • 2
  • 2
4 Comments
 
LVL 49

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 41874319
add a line of code after your append query is executed, something like:

me.subformControlName.Form.Requery

HTH
Dale
0
 

Author Comment

by:dbfromnewjersey
ID: 41874627
Thanks.   It actually had to be:

me.Parent.subformcontrolname.form.requery to get it to work.
0
 

Author Comment

by:dbfromnewjersey
ID: 41874628
.
0
 
LVL 49

Expert Comment

by:Dale Fye
ID: 41874793
glad I could help.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

877 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