By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,098 Members | 939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,098 IT Pros & Developers. It's quick & easy.

Subform and wrong display order

P: n/a
SJM
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 represents a day of the week, and the code appends a
record starting with Monday and finishing with Sunday. After appending the 7
records to a table I then refresh the screen and display the records in a
subform for the user to edit. What happens occasionally is that the days
display in the wrong order. Indexing the table did not help, and placing a
orderby on the subform results in error 2486 'you can't carry out this
action at present time'. It happens on different PCs. I would be grateful if
someone could explain why the records get jumbled when saved even though I
start with Monday and save each record before looping to the next day, and
more importantly how can I fix this. Also why would placing orderby date on
a subform result in the deadly 2486 error.
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Try using a query with sort on the date (in its SQL, this will show up as
the ORDER BY clause). By definition, the records in relational tables are
unordered, so you need to select a field on which to order them in the SQL.

And, as you've found, you can't always assume that they will always be
retrieved in a particular order just because they have been, before.

Larry Linson
Microsoft Access MVP
"SJM" <no****@ms.com> wrote in message
news:RW*****************@nnrp1.ozemail.com.au...
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 represents a day of the week, and the code appends a record starting with Monday and finishing with Sunday. After appending the 7 records to a table I then refresh the screen and display the records in a
subform for the user to edit. What happens occasionally is that the days
display in the wrong order. Indexing the table did not help, and placing a
orderby on the subform results in error 2486 'you can't carry out this
action at present time'. It happens on different PCs. I would be grateful if someone could explain why the records get jumbled when saved even though I
start with Monday and save each record before looping to the next day, and
more importantly how can I fix this. Also why would placing orderby date on a subform result in the deadly 2486 error.

Nov 12 '05 #2

P: n/a
In addition to Larry's suggestions, I'd mention that you may be using the
name Date for your field.
This can confuse Access, because Date is a built-in function which returns
the current date.
Giving the field a more specific name may help.

HTH
- Turtle

"Larry Linson" <bo*****@localhost.not> wrote in message
news:SJ*****************@nwrddc02.gnilink.net...
Try using a query with sort on the date (in its SQL, this will show up as
the ORDER BY clause). By definition, the records in relational tables are
unordered, so you need to select a field on which to order them in the SQL.
And, as you've found, you can't always assume that they will always be
retrieved in a particular order just because they have been, before.

Larry Linson
Microsoft Access MVP
"SJM" <no****@ms.com> wrote in message
news:RW*****************@nnrp1.ozemail.com.au...
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 represents a day of the week, and the code appends
a
record starting with Monday and finishing with Sunday. After appending
the 7
records to a table I then refresh the screen and display the records in
a subform for the user to edit. What happens occasionally is that the days
display in the wrong order. Indexing the table did not help, and placing a orderby on the subform results in error 2486 'you can't carry out this
action at present time'. It happens on different PCs. I would be grateful if
someone could explain why the records get jumbled when saved even though

I start with Monday and save each record before looping to the next day, and more importantly how can I fix this. Also why would placing orderby date

on
a subform result in the deadly 2486 error.


Nov 12 '05 #3

P: n/a
SJM
Thanks Turtle and Larry,
I am surprised I didn't think of this myself it is so obvious. I was running
the subform straight off the table. Now I use a query with a sort on the
date. Time will tell if it behaves, but I am sure this is the answer.

"MacDermott" <ma********@nospam.com> wrote in message
news:Sx*******************@newsread1.news.atl.eart hlink.net...
In addition to Larry's suggestions, I'd mention that you may be using the
name Date for your field.
This can confuse Access, because Date is a built-in function which returns
the current date.
Giving the field a more specific name may help.

HTH
- Turtle

"Larry Linson" <bo*****@localhost.not> wrote in message
news:SJ*****************@nwrddc02.gnilink.net...
Try using a query with sort on the date (in its SQL, this will show up as the ORDER BY clause). By definition, the records in relational tables are unordered, so you need to select a field on which to order them in the

SQL.

And, as you've found, you can't always assume that they will always be
retrieved in a particular order just because they have been, before.

Larry Linson
Microsoft Access MVP


Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.