Re: Sorting a table by concatenating several fields in the same table
From: Duane Hookom (duanehookom_at_NO_SPAMhotmail.com)
Date: 03/06/05
- Next message: Andreas: "Re: Is there any way to use a recordset object as the datasource for a query (Dao or ADO)?"
- Previous message: Scott B: "Re: Query needs tables switched"
- In reply to: salsaguy: "Sorting a table by concatenating several fields in the same table"
- Next in thread: salsaguy: "Re: Sorting a table by concatenating several fields in the same ta"
- Reply: salsaguy: "Re: Sorting a table by concatenating several fields in the same ta"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 5 Mar 2005 20:52:26 -0600
I would not rely on either the sort order of the query or the OrderBy in the
report. The more robust solution uses code like this found on Allen Browne's
web site http://members.iinet.net.au/~allenbrowne/ser-33.html.
-- Duane Hookom MS Access MVP "salsaguy" <salsaguy@discussions.microsoft.com> wrote in message news:94CFF452-C1B1-48A0-967B-0DBCED84DB90@microsoft.com... >I am creating a database to store information about printed media. For > example, a single table with separate fields for title, author, publisher, > citations, date of publishing, etc. I want the user to choose what fields > to > sort with, so that he can select a first field to sort by and a second > field > to further sort any identical entries in the first field. Ideally, I want > to > allow the user to select up to three fields for sorting. I would prefer > to > accomplish this using VB. I am using Access 2002. > > I have had no problem sorting the data with one selected field by making a > query with the Order By statement. But I have not been able to implement > the > sorting with multiple fields. I have an idea that I believe would allow > me > to continue using the Order By statement and still let the user define up > to > 3 fields (although I have not been able to implement it). I would create > a > separate field for sorting that would be left blank. When the user > selects > the fields for sorting, then those fields would be copied into the sorting > field and concatenated. I could then run a single query with the Order By > statement on the sorting field and, in effect, sort with all 3 fields > taken > into account. Then after the sorting has taken place I would need to > erase > the concatenated fields from the sorting field. > > I would be interested in any help or code. This is my first project with > Access, and although I do have some background in C++, I am learning the > VB > and SQL as I go. Thanks... > >
- Next message: Andreas: "Re: Is there any way to use a recordset object as the datasource for a query (Dao or ADO)?"
- Previous message: Scott B: "Re: Query needs tables switched"
- In reply to: salsaguy: "Sorting a table by concatenating several fields in the same table"
- Next in thread: salsaguy: "Re: Sorting a table by concatenating several fields in the same ta"
- Reply: salsaguy: "Re: Sorting a table by concatenating several fields in the same ta"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|