473,569 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sorting a SubForm


I have a relatively simple relational database. One of my forms is based
on a query with a 3 parameter sort: Status / Priority / Customer.

When I open the form, the records are sorted properly.

When I go to filter the form, to get a subset of the form, e.g. filter
by Responsible Party, I would like the form to sort this way:

Reposponsible Party / Status / Priority / Customer.

However, when I do the Filter by Form, the sort gets all screwed up, so
much so that I can't even determine that it is sorted in ANY order - it
appears random.

Virtually all my forms are doing the same thing - when I filter the
form, it loses its sort.

Help!

thanks,
carl

*** Sent via Developersdex http://www.developersdex.com ***
Dec 28 '05 #1
1 4927
There are timing issues if the form or subform's RecordSource is a query
that uses parameters that read values from the form or subform itself. Then
if you apply a filter to the form and the subform, there are bugs in Access
where it gets confused about which has a filter applied. If you try to sort
it out by setting the OrderBy and OrderByOn properties, there are further
bugs where Access gets so confused that the entire approach is unworkable.

If you want to seedetails of the bugs and a sample database to demonstrate
them, bring up this article:
Incorrect filtering
at:
http://allenbrowne.com/bug-02.html

The simplest way around the entire problem is to programmaticall y set the
RecordSource of your subform instead of relying on the Filter and OrderBy
properties. The RecordSource can handle both the filtering (the WHERE clause
of the query statement), and sorting (the ORDER BY clause.) Typically, you
would set this in the AfterUpdate event of some control and/or the Current
event of the form or subform.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"aintnorock " <no****@xyz.com > wrote in message
news:gC******** *******@news.us west.net...

I have a relatively simple relational database. One of my forms is based
on a query with a 3 parameter sort: Status / Priority / Customer.

When I open the form, the records are sorted properly.

When I go to filter the form, to get a subset of the form, e.g. filter
by Responsible Party, I would like the form to sort this way:

Reposponsible Party / Status / Priority / Customer.

However, when I do the Filter by Form, the sort gets all screwed up, so
much so that I can't even determine that it is sorted in ANY order - it
appears random.

Virtually all my forms are doing the same thing - when I filter the
form, it loses its sort.

Help!

thanks,
carl

Dec 28 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
24787
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that contains the subform is named Clients. I have this code in the Add Client btn: If Forms!Clients.subformVisits!VisitDirty = True Then MsgBox "Visit...
25
10184
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab...
4
6985
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which...
18
5728
by: Scott | last post by:
I have a collection where the items in the collection are dates. I want to iterate over the collection and build a value list string for the rowsource of a listbox. The dates in the collection are not in chronological order. Is there a way to first sort the collection and put the dates in chronological order before creating the value list...
6
5955
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few forms in the database that will use this function, so I need to be able to tell the code which form to unlock. What I have is as follows: Public...
2
1725
by: John | last post by:
I have a mainform with a subform. The subform is sorted on a specific field and when I just open the subform, the sorting is OK. However, when I open the mainform, the sorting in the subform is gone. The subform has no data link to the mainform. How can I persist my sorting in the subform? Thanks in advance, john
1
1654
by: danisk | last post by:
My database has a main form with a subform with several sub-subforms. When I sort data in my sub-subforms, the sort will save while viewing only the subform and sub subform but not when linked to the main form. Does anyone know how to fix this?
25
14818
by: hjozinovic | last post by:
Hi! I have a MainForm and a SubForm on it. They're linked and can be filtered, sorted etc... I designed MainReport and SubReport that should match filter and sort criteria from MainForm and SubForm. I have a PrintButton on MainForm that opens the report! At this moment my MainReport is being filtered and sorted excatly the way the MainForm...
1
1479
by: pyotr | last post by:
Hello,,,, I have a form with its subform that is filtered through the combination of two independent comboboxes to facilitate administration. However, I want to arrange/sort the viewed results according to one Field which is the Start (date).
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7982
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6286
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.