Sort order in the Expression Builder

JohnH
3StarLounger
Posts: 287
Joined: 09 Mar 2010, 23:16
Location: Canberra Australia

Sort order in the Expression Builder

Post by JohnH »

The middle box of the Expression Builder lists all the objects on a selected form or report.

I often find it hard to find things in the list as they seem to be in a completely random order.
Or is there some order there that I can't see? (They are certainly not in alpha order, nor the order in which they are added to the form, nor the Tab order)
You do not have the required permissions to view the files attached to this post.
Regards

John

User avatar
HansV
Administrator
Posts: 78466
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Sort order in the Expression Builder

Post by HansV »

I can't find out if there is any logic to the order in which the objects are listed either. As far as I know, there is no way to change this order. :sad:
Best wishes,
Hans

JohnH
3StarLounger
Posts: 287
Joined: 09 Mar 2010, 23:16
Location: Canberra Australia

Re: Sort order in the Expression Builder

Post by JohnH »

Thanks for looking.
Regards

John

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: Sort order in the Expression Builder

Post by agibsonsw »

I assumed they are in the order of the "control order" on the form. That is, the order in which controls were added to the form or the Tab Order if this has been changed.
But I've never checked this. Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

User avatar
HansV
Administrator
Posts: 78466
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Sort order in the Expression Builder

Post by HansV »

It appears to be neither the tab order nor the order in which the controls were created, but a kind of mixture of these...
Best wishes,
Hans

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: Sort order in the Expression Builder

Post by agibsonsw »

Maybe it's in a 'short-term' memory order :smile:
"There was a text box and, oh I remember now, a label,..."
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

JohnH
3StarLounger
Posts: 287
Joined: 09 Mar 2010, 23:16
Location: Canberra Australia

Re: Sort order in the Expression Builder

Post by JohnH »

That is, the order in which controls were added to the form or the Tab Order
I did a test where I added a control to a complex form. Most of the stuff already there is on the various pages of a tab control. So the new control was given a tab index of 2.

In the expression builder the new control appeared down towards the bottom, but still some way from last.
Regards

John

Rui
StarLounger
Posts: 57
Joined: 02 Sep 2011, 10:44

Re: Sort order in the Expression Builder

Post by Rui »

JohnH wrote:
That is, the order in which controls were added to the form or the Tab Order
I did a test where I added a control to a complex form. Most of the stuff already there is on the various pages of a tab control. So the new control was given a tab index of 2.

In the expression builder the new control appeared down towards the bottom, but still some way from last.
Yes, it happened just like that with me too. I was ready to swear it was the creation order that mattered, until I saw that happening :scratch: .

JohnH
3StarLounger
Posts: 287
Joined: 09 Mar 2010, 23:16
Location: Canberra Australia

Re: Sort order in the Expression Builder

Post by JohnH »

I am not sure whether this helps much, but I have found that the order in the Expression Builder is the same as in the list produced by this routing.

Code: Select all

Public Sub sbListControls(frmForm As Form)
    Dim ctrl As Control
    For Each ctrl In frmForm.Controls
        Debug.Print ctrl.Name
    Next ctrl
    Set ctrl = Nothing
End Sub
Regards

John