472,973 Members | 2,491 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,973 software developers and data experts.

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 4048
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mary Litten | last post by:
Hi - (This is my very first post) I have gotten to this point of registering to post because I have been spinning my wheels so long, I believe I am all caught up in the weeds. (and mud) I have...
3
by: SJM | last post by:
I have a problem that occurs occasionally with a db for a undetermined reason which I would love to solve. I construct and append a series of 7 records to a table using ADO recordset. Each record...
12
by: Paul T. RONG | last post by:
Is it possible to divide a tall subform with 80 records to two subforms each with 40 records? Dear All, What I have: Tables: tblProduct, tblOrder, tblOrderDetail
5
by: DS | last post by:
I have a form with 2 Subforms...The first subform is linked to the main form. The second Subform is liked to the first subform. Whenever I add a record to the first subform that works fine. When...
3
by: Simone | last post by:
Hi All, I have a Find Record button setup in most of my forms in order to find a specific customer's details. I have just noticed today though that this search will only find the customer if it...
3
by: stuart.medlin | last post by:
I have an Access 97 application that has a basic form (Transcript) and subform. The subform has a query as a recordsource that returns records from a table: SELECT DISTINCTROW Transcript.NCID,...
4
by: virtualgreek | last post by:
Dear All, First of all I would like to take the time to thank you all for your efforts and time spent at this wonderful forum. I have found it very helpful with numerous examples available for...
5
by: blakerrr | last post by:
Hi everyone, I have a form called Master Order with a subform in it called Order Info. The subform has a nested subform in it called Order Details. Master Order cycles through all of the parts...
1
by: stuart | last post by:
I have a list of records in a subform that a user can either edit or delete. This is an unbound form. If the user deletes a record, I want to refresh the form, and then position the cursor on the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.