Prevent Append Query from Autosorting Data

fortwrestler

Registered User.
Local time
Today, 00:52
Joined
Jan 15, 2016
Messages
50
Table A - Three Fields
1 - ID Field(autonumber)
2 - Filler Name (duplicates)
3 - Reason (duplicates, somewhat)

Table B - Six Fields
1 - ID(autonumber)
2 - Filler Name(dup)
3 - EntryDate(dup)
4 - Reason(dup, sometimes)
5 - Number of Stops on Days
6 - Number of Stops on Nights

Query(Append)
Query requires a Filler input and Entry Date input. It then looks up Table A and pulls the reason. It then appends this reason and entry date into Table B.

My issue is that the appended Table B is sorted by Entry Date then Reason. I'm fine with the Entry Date, but I do not want the Reason to be sorted. The order I have in Table A is the order I want in Table B once appended.

I've searched for a while and haven't found any viable solutions (no shortcut menu option, order on load doesn't change if NO)

Can anyone help to prevent this auto filter during the append?

I will post pictures of these tables with sample data as well.

Table C is the append query.

Table C(SQL):

INSERT INTO [Stop Table Tracker] ( Line, EntryDate, Reason )

SELECT DISTINCTROW [Forms]![frm_02_MainEntrySt]![Line] AS Expr1, [Forms]![frm_02_MainEntrySt]![EntryDate] AS Expr2, [Reason Constants].Reason

FROM [Reason Constants]

WHERE ((([Forms]![frm_02_MainEntrySt]![Line])=[Reason Constants].[Line]))

GROUP BY [Forms]![frm_02_MainEntrySt]![Line], [Forms]![frm_02_MainEntrySt]![EntryDate], [Reason Constants].Reason

HAVING ((([Forms]![frm_02_MainEntrySt]![Line])<>""));
 

Attachments

  • Table A.PNG
    Table A.PNG
    49.8 KB · Views: 80
  • Table B.PNG
    Table B.PNG
    74.5 KB · Views: 69
  • Table C.PNG
    Table C.PNG
    14.1 KB · Views: 74
Records in tables have no intrinsic order. The order they display in the table is not controllable except by using the facilities in the context menu of the field which shows the results of what is essential a query.

You would need a field that can be ordered in both tables if you want them to be the same.
 

Users who are viewing this thread

Back
Top Bottom