Subform changes record order after edits

G

Gary

I have continuous form subform "sfrmProductComponents on a mainform
"Products" to enter/view Product details. The subform is based on a query
joining several tables. I have a combo box which selects
ComponentsCategories and displays a dialog form via the afterUpdate event to
filter/Select a Component. There are other fields such as Quant, extended
price etc.

All is working well, however while testing the subform by changing category
and component choices and varifying results, I noticed that the displayed
records in sfrmProductComponents will randomly change order. All data seems
accurate, the records just shift order. I have looked at the subform query
and the datalist does not change relative order.

I am new to Access and curious as to why this behavior is occuring. I would
appreciate anyone's comments and recommendations.

Thanks Gary
 
W

Wayne Morgan

Did you specify a sort order in the query? To do so, pick the fields you
want sorted and set the to Ascending or Descending in the Sort row of the
query design grid. The columns will be sorted in the order you have them
listed from left to right. If you don't specify a sort order, there is no
restriction on what order the records will be returned.
 
G

Gary

Wayne Morgan said:
Did you specify a sort order in the query? To do so, pick the fields you
want sorted and set the to Ascending or Descending in the Sort row of the
query design grid. The columns will be sorted in the order you have them
listed from left to right. If you don't specify a sort order, there is no
restriction on what order the records will be returned.

Wayne
Thanks for your reply. It is a discovery every minute at this stage of my
level of experience with Access. After reading your answer, I did try a sort
order in the Query and that settled everything down . Obviously, there is
some other underlying default sort order which is used if I do not provide a
sort order in the query. I just *assumed* that it would use table order.
Thanks again for your prompt reply.
Gary
 
Top