Ordering a Combobox - standard solution not working (1 Viewer)

el sjaako

New member
Local time
Today, 05:16
Joined
Jan 20, 2009
Messages
3
I feel like I'm doing something very stupid. I'm using access 2007.

I've got a combobox, and I want the newest items (sortable by ProjectID or R_number - it doesn't matter) at the top.

The row source is

SELECT DISTINCTROW Projects.ProjectID, Projects.R_number, Projects.recv_date, Projects.Customer_name, Projects.PO_number, Projects.Customer_contact, Projects.Customer_addr1, Projects.technician
FROM Projects
WHERE (((Projects.invoice_number)='0'))
ORDER BY Projects.ProjectID DESC;

It does give the right result, except it doesn't sort descending. It sorts the same way as when I remove the DESC. If I press the dots next to the row source and press "view" it shows the results in a table, sorted correctly. I tried looking it up, but I only found advice to try "order by".

Did I miss the "sort rows by" option in the properties (I looked several times...)? Doesn't this work with large queries?

Thanks
 

DCrake

Remembered
Local time
Today, 04:16
Joined
Jun 8, 2005
Messages
8,632
Syntax seems fine, however try creating a new query based on the syntax, run it and see if the results are what you expected, if so, then save the query and use this as your rowsource/recordsource.

David
 

el sjaako

New member
Local time
Today, 05:16
Joined
Jan 20, 2009
Messages
3
Nope, got exactly the same result, even after closing and opening the form.

I did in the process of testing this find out that new comboboxes work fine (I knew I was doing something stupid).

Thanks for the help anyway.

Edit: Even stupider reason: The VBA code changed the rowsource :eek:. This is why I hate working with other peoples projects.
 
Last edited:

Users who are viewing this thread

Top Bottom