There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Business Applications
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Business Applications >
Subform not always sorting correctly


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
DKTaber's Avatar
Computer Specs
Senior Member with 904 posts.
 
Join Date: Oct 2001
Location: Wilmington, DE
Experience: Advanced
05-Jun-2004, 11:10 AM #1
Subform not always sorting correctly
Have a continuous Access 2000 subform that contains a date field (LtrDate). The subform is in an input form. I want the subform to sort its records in descending order by that date field. It doesn't. Some records ARE in the correct decending order, but only by coincidence. The question is why?

I have
  • entered in the Orderby property of the subform "LtrDate DESC"
  • sorted the table which is the control source in DESC order by LtrDate and saved
  • opened the form, clicked the LtrDate field, and clicked the Z-A sort button on the toolbar
Nothing produces the right sort order in the subform.

What's wrong?
__________________
Don Taber
Wilmington, DE

Last edited by DKTaber : 05-Jun-2004 01:56 PM.
MustBNuts's Avatar
Senior Member with 1,930 posts.
 
Join Date: Aug 2003
Location: Nevada
05-Jun-2004, 08:37 PM #2
I have a similar setup for a system I built quite a few years ago: Main form is Company information (name, address, tel, etc.), subform is a history of activity (date, memo field). I have this loading in date order, most recent first.

What I did to create this was to build the subform around its own query for the data source. The table for this subform only has three fields (co name, date, history), the query sorts first by company, then by date (so that as you are scrolling through the main form and land on a specific company, it is linked to its appropriate history and will populate in reverse date order).

Hope this helps,

MBN
__________________
I'll burn that bridge when I get to it!
DKTaber's Avatar
Computer Specs
Senior Member with 904 posts.
 
Join Date: Oct 2001
Location: Wilmington, DE
Experience: Advanced
06-Jun-2004, 08:43 AM #3
MustBNuts: Thanks. I have done the same thing many times (using a sorted query as the data source). In this case, I don't need a query because have nothing special I want to do with the table data... except sort it. I still can't understand why Access ignores the OrderBy property. But since it does, I guess I'll have to do it thru a query.
__________________
Don Taber
Wilmington, DE
DKTaber's Avatar
Computer Specs
Senior Member with 904 posts.
 
Join Date: Oct 2001
Location: Wilmington, DE
Experience: Advanced
06-Jun-2004, 03:51 PM #4
MustBNuts: Just to close the loop, I created a query sorted in descending order by LtrDate, and (of course) the form now displays the records in that order. Still bewildered by Access ignoring the OrderBy property.
Chris_E's Avatar
Senior Member with 296 posts.
 
Join Date: Feb 2006
Location: Wellingborough, UK
Experience: I have no idea what I don't know - how could I?
02-Jul-2008, 06:12 AM #5
I've just created a subreport, based on an underlying query.

Regardless of the sort order I set within that query (I want it to sort by Date (Ascending), when presented within the main report, the data in the subreport is not sorted by date, rather by the primary key of the query (which do I want to show but not as the focus of the sort).

If I run the query in isolation of the form, the results are shown in sorted order and if I just run the subform up, its also sorted ok, but never when I look at the subform within its main form.

I use the same query for the data entry subform as the reports subreport and it works fine for the form, but not the report!

Do SubReport sorts behave differently to SubForm sorts?

Can someone suggest where I should look to address this?

Thanks

Chris
Chris_E's Avatar
Senior Member with 296 posts.
 
Join Date: Feb 2006
Location: Wellingborough, UK
Experience: I have no idea what I don't know - how could I?
02-Jul-2008, 06:18 AM #6
Argh!

Just spotted the "Sorting and Grouping" facility for Reports.

Why is this tucked away and why cant the query just do it on its own for goodnes sake!

Closed!

Chris
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,364 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
02-Jul-2008, 06:26 AM #7
Microsoft
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 02:33 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.