subform sort failure

G

Guest

have a main from based on a table, sorted in ascending text order, with a
subform, based on a temporary table sorted on Surname. When actioned the
subform sorts on a different field, the 1st in the subform irrespective of
what I try and do. I need to keep the temporary table to identify changes to
data and not use a query based subform. The field in question does not form
part of the Primary key on the table, but I have tried adding it to no avail.
The 1st field that is Sorted by on the subform is part of the Primary Key
however. Have I missed something, as it should be simple to sort by the
required field.

Cheers,
Steve
 
T

tina

When actioned the
subform sorts on a different field, the 1st in the subform irrespective of
what I try and do

since you didn't tell us *what* you've already tried, we'll have to start
from scratch. try setting the subform's SortOrder in VBA, as

Me.OrderBy "MyFieldName"
Me.OrderByOn = True

substitute the name of the field you want to sort by.

hth
 
G

Guest

Many thanks Tina,

I had a Requery in the onLoad event after building the temporary table and
it needed the orderby statements to work.

Cheers,
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top