table isn't in the correct order.
Not trying to be snippy here, but who cares? You rarely ever have to worry about how a table sorts its records - nor should you. A table has oft been compared to a bucket of marbles, i.e there is no sort or guarantee of a sort. Not even when it uses autonumbers. Sorting is what queries do, and forms based on them will abide by the sort.
Only once or twice in 20 years did I ever have to worry about a sort in a table but I can't recall why. That was controlled via a number field that the table was sorted on, but those were program support tables, not regular record keeping tables. Maybe you have a valid case as to why the records must be entered in a particular order. If so, I'd be interested to know what that is. I'll speculate here that the designers of Access considered the analogy I gave when they decided not to control the order of an append query - assuming that the behaviour is normal and I'm not off my rocker.
EDIT:
Best guess is the docmd.openquery is running before the docmd.runsql completes. Is this possible?
MY money is on No, not possible.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.