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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing a Query after a record is added or changed

Status
Not open for further replies.

np3il

Programmer
Joined
Aug 15, 2002
Messages
63
Location
US
My query is mad of two tables with the same fields and I need to requery or refresh this query at run-time.

Is there a way to refresh a query after a new record has been added or if a record is modified?

Thanks
Np3il
 
The query will always dispay the data that is in the table. So if you edit/add data, that is the data that is then displayed in the query.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
I agree but it is not the case that I am having.

Ex. A SubForm has a query for the source and I add a new record to on of the tables.

Maybe the question should be:
How can I run an existing query from code (that create a working table that is composed of two other tables)???

I hope I have explained the situation.

Regards
Np3il
 
Have a look at the Requery method of the Form object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hello All

The requery method did not work but I found another way.

In the Subform (using multiple subforms):
'Close Subform
Form!fsumParkSub.SourceObject = ""
'refresh
DoCmd.RunSQL "SELECT AllEmp.* INTO tmasEmployee FROM [SELECT * FROM Employee0405 UNION SELECT * FROM Employee0506]. AS AllEmp;"
'open Subform
Form!fsumParkSub.SourceObject = "fsumParkSubEmpl"

This worked very nicely
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top