As I can to foresee from your code, it is a SUBFORM. If
Open MAIN FORM in design view, click on the margin of the
SUBFORM, open properties box, fill up LINK CHILD FIELDS and LINK MASTER FIELDS properties.
Actually it is not sub form. Normally i will do the form wizard to do for us with abit of modifying the code for list range function. I use the "detail" form to design to list out the records. But i have not know the code how to stop the listing out all the records when i open this form from the switchboard. Only when a person input the specific number to limit the records, it will list out.
It is not sense when a person open the form, it immediately list out everything without input anything at all. -_- ...
Tcase gave you the answer. If you add a filter to the recordsource of the form that will give as result 0 records it prevents all records from being shown upon opening the form. Then after input of the start and end order ID's and clicking the button you can change the filter to the desired values. However as Teddy says a textfield behaves differently from numeric fields when using ORDER BY or BETWEEN:
Text columns containing the values 1, 2 and 10 are sorted:
Numeric columns containing the values 1, 2 and 10 are sorted:
So make sure to choose the proper fieldtype in your tables