473,417 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Sorting form records on the unbound column in a combo box on the form

Hi. I want to sort the records on my form (using either a continuous form
or a
datasheet) by the unbound "description" column in a combo box on the form
(or in the datasheet.) Here's a rough text representation of what I'm
talking about

FORM

Item Number Description Category
(text box) (text box) (combo box - 2 columns)

1001 Item 1 Col1=100 Col2=CategoryName3
1002 Item 2 Col1=101 Col2=CategoryName4
1003 Item 3 Col1=102 Col2=CategoryName1
1004 Item 4 Col1=102 Col2=CategoryName1
1005 Item 5 Col1=103 Col2=CategoryName2

So..when the form loads, it is sorted by the Item Number. I want my users
to be able to sort by Category as well by clicking a command button. If I
only reference the Category column in the "OrderBy" property, it will sort
on the first column in the combo box (which is invisible to the user) and
not on the text in the second column. That's what I'm trying to alter
programatically - to sort on the text (as the "Sort Ascending" and "Sort
Descending" commands do when you manually apply the sort order.

Thanks again to anyone who might be able to help.

Todd

Nov 13 '05 #1
2 3817
"Todd" <to**********@penland.net> wrote in message
news:yE***************@fe25.usenetserver.com
Hi. I want to sort the records on my form (using either a continuous
form or a
datasheet) by the unbound "description" column in a combo box on the
form (or in the datasheet.) Here's a rough text representation of
what I'm talking about

FORM

Item Number Description Category
(text box) (text box) (combo box - 2 columns)

1001 Item 1 Col1=100
Col2=CategoryName3 1002 Item 2
Col1=101 Col2=CategoryName4 1003 Item 3
Col1=102 Col2=CategoryName1 1004 Item 4
Col1=102 Col2=CategoryName1 1005 Item 5
Col1=103 Col2=CategoryName2

So..when the form loads, it is sorted by the Item Number. I want my
users to be able to sort by Category as well by clicking a command
button. If I only reference the Category column in the "OrderBy"
property, it will sort on the first column in the combo box (which is
invisible to the user) and not on the text in the second column.
That's what I'm trying to alter programatically - to sort on the text
(as the "Sort Ascending" and "Sort Descending" commands do when you
manually apply the sort order.

Are you talking about the form or the combobox?

Just replace the recordsource/rowsource with a new SQL statement/query
sorted however you like.
--
regards,

Bradley
Nov 13 '05 #2
I'm talking about sorting the records on the form. I know how to sort the
values in the combo box but that's not what I'm trying to do. I want to be
able to sort the records on the form based on the visible "text" value in
the second, unbound column of the combo box.

"Bradley" <no**********@address.com> wrote in message
news:Kg******************@news-server.bigpond.net.au...
"Todd" <to**********@penland.net> wrote in message
news:yE***************@fe25.usenetserver.com
Hi. I want to sort the records on my form (using either a continuous
form or a
datasheet) by the unbound "description" column in a combo box on the
form (or in the datasheet.) Here's a rough text representation of
what I'm talking about

FORM

Item Number Description Category
(text box) (text box) (combo box - 2 columns)

1001 Item 1 Col1=100
Col2=CategoryName3 1002 Item 2
Col1=101 Col2=CategoryName4 1003 Item 3
Col1=102 Col2=CategoryName1 1004 Item 4
Col1=102 Col2=CategoryName1 1005 Item 5
Col1=103 Col2=CategoryName2

So..when the form loads, it is sorted by the Item Number. I want my
users to be able to sort by Category as well by clicking a command
button. If I only reference the Category column in the "OrderBy"
property, it will sort on the first column in the combo box (which is
invisible to the user) and not on the text in the second column.
That's what I'm trying to alter programatically - to sort on the text
(as the "Sort Ascending" and "Sort Descending" commands do when you
manually apply the sort order.

Are you talking about the form or the combobox?

Just replace the recordsource/rowsource with a new SQL statement/query
sorted however you like.
--
regards,

Bradley


Nov 13 '05 #3

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

Similar topics

9
by: Frances | last post by:
Hi All, * PREMISE * I'm creating an Access form with 150 items subdivided into 20 categories. Multiple categories (and items) can be selected so my user wants checkboxes. All of the options...
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
3
by: pelcovits | last post by:
I am trying to set up an unbound form to enter report criteria. I've followed the MS Office Assistance document: "Create a form to enter report criteria" which describes how to enter data (such...
3
by: Stig | last post by:
Hi, Any help on this one will be greatly appreciated as I have spent too long banging my head against the screen trying to get it sorted. Basically I would like to have a select all records...
1
by: Jimmy Stewart | last post by:
I have a continuous form has an unbound field named "Client". Its controlsource is " =.(1) " This allows me to display the client name without the combo box dropdown arrow. I want users to be able...
2
by: Mark Roughton | last post by:
I have a form where the users need to view records for various criteria, one of which is a date field on which they may wish to view all related data for the selected date, for all dates upto and...
1
by: Kev | last post by:
Hi, I am trying to total a column (Shift1) in a subform (continous forms) from the after update event of the (Shift1) column control within the subform. This column stores shift codes, I want to...
7
by: Katherine | last post by:
I'm trying to filter the records on the mainform (MailingList) of my database using a field contained in a subform (Donations). I was basing my code off Allen Browne's Access Tips page (here:...
7
by: DeZZar | last post by:
Hi all, Unfortunately I am quite a novice with Access!! I've created a number of data bases for my work however becuase my skills are limited to really built in functionality and wizards my...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.