Subform On Order Not working (1 Viewer)

NearImpossible

Registered User.
Local time
Today, 07:06
Joined
Jul 12, 2019
Messages
225
I have a main form with 2 SubForms on it.

on SubForm 2, I set the Order By to MaintenanceID Desc and when I open that form on its own, it sorts correctly, however when I lauch the main form, SubForm 2 no longer sorts correctly.

Please advise what I am missing

thank you
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:06
Joined
Oct 29, 2018
Messages
21,454
Did you set up the Link Master/Child Fields for SubForm 2? If so, what exactly does it mean by "no longer sorts correctly?"
 

NearImpossible

Registered User.
Local time
Today, 07:06
Joined
Jul 12, 2019
Messages
225
Did you set up the Link Master/Child Fields for SubForm 2? If so, what exactly does it mean by "no longer sorts correctly?"

It is an unbound form until a tabctrl is selected and then Sub Form and linking are specified.

Code:
Me.FacilityMaintenanceNotes.SourceObject = "FacilityMaintenanceNotes"
Me.FacilityMaintenanceNotes.LinkChildFields = "FacilityID"
Me.FacilityMaintenanceNotes.LinkMasterFields = "FacilityID"

and by sorting, on the FacilityMaintenanceNotes SubForm I am tracking a MaintenanceID, by which I want to order the records in reverse order.

If I open the FacilityMaintenanceNotes SubForm on its own, everything is ordered by the MaintenanceID in reverse order, i.e. 6-1 (how I want it to be), but when opening the main form, everything on that SubForm is ordered in order, i.e. 1-6. like it is ignoring the Order By specification.

FYI: Order By On Load is set to Yes
 

NearImpossible

Registered User.
Local time
Today, 07:06
Joined
Jul 12, 2019
Messages
225
I got it to work by adding OrderBy Code in the VBA vs using the form properties, not sure why it didn't work on the properties tab....
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:06
Joined
Oct 29, 2018
Messages
21,454
I got it to work by adding OrderBy Code in the VBA vs using the form properties, not sure why it didn't work on the properties tab....
Glad to hear you got it sorted out. Cheers!
 

Users who are viewing this thread

Top Bottom