468,294 Members | 1,926 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,294 developers. It's quick & easy.

A2K - keeping subform records in the same order

Hi,

I was just setting up a test system on a client's machine yesterday and as
ever noticed a few problems.

One that has thrown me is to do with the order of records in a subform
(datasheet view).

The main form holds the parent records. For each parent record there are 10
(and always 10) related records. When these 10 records appear in the
subform the first field is numbered from 1 to 10.

Like so:

1 - record here
2 - record here
3 - record here
4 - record here
5 - record here
etc to 10

Yesterday I noticed that sometimes the order was changed, eg.

10
9
8
1
2
3
4
5
6
7

There is quite a bit of complexity behind the whole thing but I don't want
to confuse the issue. Is there a relatively simple way of checking the
order of records as they appear in the subform and then re-ordering them if
necessary?

Many thanks again,

Martin
Nov 12 '05 #1
2 3845
Set the subform's OrderBy property to the name of this field, remembering to
set OrderByOn as well. If necessary, do this in the Open event of the
subform.

Example:
Me.OrderBy = "SomeField"
Me.OrderByOn = True

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"Deano" <ma************@hotmail.com> wrote in message
news:e2***************@wards.force9.net...
Hi,

I was just setting up a test system on a client's machine yesterday and as
ever noticed a few problems.

One that has thrown me is to do with the order of records in a subform
(datasheet view).

The main form holds the parent records. For each parent record there are 10 (and always 10) related records. When these 10 records appear in the
subform the first field is numbered from 1 to 10.

Like so:

1 - record here
2 - record here
3 - record here
4 - record here
5 - record here
etc to 10

Yesterday I noticed that sometimes the order was changed, eg.

10
9
8
1
2
3
4
5
6
7

There is quite a bit of complexity behind the whole thing but I don't want
to confuse the issue. Is there a relatively simple way of checking the
order of records as they appear in the subform and then re-ordering them if necessary?

Many thanks again,

Martin

Nov 12 '05 #2
Allen Browne wrote:
Set the subform's OrderBy property to the name of this field,
remembering to set OrderByOn as well. If necessary, do this in the
Open event of the subform.

Example:
Me.OrderBy = "SomeField"
Me.OrderByOn = True


Thanks Allen, that looks like what i need - hopefully a simple fix to an
irritating problem.

<my original post snipped>
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by DS | last post: by
3 posts views Thread by Simone | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.