Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically sort based on ChangeOrder Field 2

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
I have the below code on a command button that will sort
records based on a number in the ChangeOrder field on
the form. This works good. I can change the number in the
ChangeOrder field and sort the records the way I need.

These records are PartNumbers and are always associated
with a ECN Number. My issue is when I go back to this ECN
Number and I view the PartNumbers on the subform I need
for them to automatically sort based on the Numbers in the
ChangeOrder field. Rignt now they always go back to the
original order. How can I do this? Do I need to put
this same code on another Event to accomplish this?

Code:
Me.OrderBy = "ChangeOrder " & SortDir
Me.OrderByOn = True
 
Use the name of the control hosting the subform instead of the name of the subform.
 
Everyone:

There is something that I guess I do not understand about
Pages with a form. The form Name is [ECNPartsfrm2] but there
is a name of something around the form on the page that is
Names [ECNPartstblfrm2]. I do not know what that is, but
when I changed the code to reflect that name it is working!
What am I not grasping here?? I inherited this database and
I have never fulled with forms that have pages or tabs
acrossed the top. If I have reported this wrong I certainly
apologize to all involved. Thanks for all of your help!
 
In order to have a subform on a form, you must first have a subform control. The subform control contains a form - this is the subform. Have a look at the Source Object property of the subform control, you will see it is set to the name of the form contained by the subform control. The confusion is due to subform controls often having the same name as the form contained.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top