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

Macros and Queries

Status
Not open for further replies.

risoam

MIS
Apr 17, 2002
33
US
I have a bunch of append queries that the end result have the same data picture so all append to one output table. Instead of me having to manually run each query, I have made a macro to just go down the list and run each query automatically. It seems that sometimes the steps in the macro go out of sequence mixing the data together. Does anyone know what I mean or has seen this?
 
By "mixing the data together" do you mean that when you open the table, the rows from different queries appear to be interspersed? It may be that you've unintentionally applied sort criteria while viewing the table. For example, if you sorted on a column in a previous viewing session, and then you saved the table while it was still sorted, Access will remember the sort criteria you were using when you open it again. Try choosing Records|Remove Filter/Sort from the menu to clear the sort criteria.

However, let me give you some advice. You should never depend on any relational database giving you data in a specific order, UNLESS you specifically ask for that order (using an ORDER BY clause in SQL, or the Sort row in a query grid, or the Sorting and Grouping dialog in a report). If you don't do that, the order of the returned data is undefined. The reasons are very technical, but simply put, it allows the database engine to execute more quickly.

Past and current versions of Access have always displayed plain table rows in the order they were inserted into the table. But that has never been guaranteed, and if you depend on it, you might have an unpleasant surprise some day after you upgrade. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top