Record Order?

  • Thread starter Thread starter Scott Viney
  • Start date Start date
S

Scott Viney

Morning All,

How is the order governed in a subform datasheet view?

For instance it is base soley on a table and I set the order to ascending
via the table headings for one field does it then take this as law when you
create the form?

Or say for instance I make a query to join information from one table and
another table then set the order to ascending for a certain field in the
query, does it then take this as law when you create the form?

Or is it possible to change what the field the records are sorted on in an
already created form? At the moment I have a subform where everything is
sorted by productid. If I change the query on which the subform is based to
order, ascending on the brand field, then reopen my form with this subform.
The subform flashes as though its doing something behind the scenes and my
totals in the main form dont have any total. If I change it back to the way
it was, no problems.

What am I missing here?

Scott V
 
Heya Rick,

I have changed the 'orderby' property of my subform to "BrandName" I even
tried "BrandName DESC". Nothing is affected?

Any ideas? Have I got the syntax right for the 'orderby' property?

Scott V
 
Scott said:
Heya Rick,

I have changed the 'orderby' property of my subform to "BrandName" I
even tried "BrandName DESC". Nothing is affected?

Any ideas? Have I got the syntax right for the 'orderby' property?

Confusingly, a Form's OrderBy property is useless unless you also set the
OrderByOn property to True and that property is not exposed in the property
sheet and must be set in code. Since you have to set that in code you might
as well set OrderBy as well since the user can change that on you.

In the Form's Open event...

Me.OrderBy = "BrandName DESC"
Me.OrderByOn = True

Usually you can just specify a Sort Order in the query that the form is
bound to and that will work.
 
Thanks Rick,

Ive been screwing around with it while waiting for an answer. And yep went
back and changed the query. Then rebuilt the subform.

Cheers for the help,
Scott V
 
Back
Top