Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show newly appended records on a form 1

Status
Not open for further replies.

reg999

Technical User
Jan 17, 2005
37
US
Yet another silly question.

I have a form with a button that needs to do the following:

-run a query appending data to a table (underlying the form)
-close the form
-re-open the form to show the last entry in the table.

Everything works up to re-opening the form. When the form re-opens it only shows the last record prior to the append.

How do I cause an update to the table prior to re-opening the form?

Thank you in advance for helping.
Reg

 
What is your actual code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Sorry.
BTW "StockNumber" is both, AutoNumber and the primary key.



Dim stLinkCriteria As String

stLinkCriteria = "[StockNumber]=" & DMax("[StockNumber]", "Main")

DoCmd.SetWarnings False
DoCmd.OpenQuery "OrdrUpdtQry"
DoCmd.OpenQuery "OrdAddOpts"
DoCmd.OpenQuery "OrdAddFeats"
DoCmd.Close acForm, "Trailers"
DoCmd.OpenForm "Trailers", , , stLinkCriteria
DoCmd.SetWarnings True
 
...
DoCmd.Close acForm, "Trailers"
stLinkCriteria = "[StockNumber]=" & DMax("StockNumber", "Main")
DoCmd.OpenForm "Trailers", , , stLinkCriteria
...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top