Subform record order? (1 Viewer)

Atthe

Member
Local time
Today, 19:24
Joined
Oct 26, 2021
Messages
57
Hi All,

My database seems to have developed an issue. When I am adding new records using an emulated spiltform the record goes into the split form at the bottom (expected behaviour) but when I requery/or close re open the form all the records I have entered today appear first despite the PK being larger than the existing records below?

the table is sorted smallest to largest on the correct field

I have tried adding order by in vba in the on load event but this doesn't seem to make a difference

Does anyone have any ideas?

Cheers
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 02:24
Joined
May 7, 2009
Messages
19,231
use a "real" split form.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 19:24
Joined
Feb 19, 2013
Messages
16,606
the table is sorted smallest to largest on the correct field
what is the 'correct field'?
 

Gasman

Enthusiastic Amateur
Local time
Today, 19:24
Joined
Sep 21, 2011
Messages
14,231
Hi All,

My database seems to have developed an issue. When I am adding new records using an emulated spiltform the record goes into the split form at the bottom (expected behaviour) but when I requery/or close re open the form all the records I have entered today appear first despite the PK being larger than the existing records below?

the table is sorted smallest to largest on the correct field

I have tried adding order by in vba in the on load event but this doesn't seem to make a difference

Does anyone have any ideas?

Cheers
Yes, you are causing this in some way. I say that, as I had the same setup and it works as expected.
 

Gasman

Enthusiastic Amateur
Local time
Today, 19:24
Joined
Sep 21, 2011
Messages
14,231
Well look at the data tab for the mainform, as if the subform has the latest at the top, so will the mainform.
 

Atthe

Member
Local time
Today, 19:24
Joined
Oct 26, 2021
Messages
57
I can't see anything amiss
 

Attachments

  • Main form.PNG
    Main form.PNG
    13.1 KB · Views: 296
  • Subform.PNG
    Subform.PNG
    5.9 KB · Views: 299

Gasman

Enthusiastic Amateur
Local time
Today, 19:24
Joined
Sep 21, 2011
Messages
14,231
So you are NOT using a table, but a query which is not even sorted? :(
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:24
Joined
Feb 19, 2002
Messages
43,213
Add an Order By clause to the form's RecordSource query and remove the sort property.
 

Users who are viewing this thread

Top Bottom