Report (created by Query) Sorting a combo box.

kacey8

Registered User.
Local time
Today, 14:44
Joined
Jun 12, 2014
Messages
180
Hi all,

Another simple one I hope. I have a combo box which when filled in has the following in it

Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Monday

I have a report which brings back data based on these (ie how many enquries were received on each day)

However when I run the report, I can't seem to get the report to sort in the following weekday list, I only either get it in A-Z or Z-A etc.

Any advice?
 
Where/What is the Combo Box filled from, i.e. a Table, a Field in the Table?
 
if the combo box is from a field in a table then you dont need to sort it at all, it will just display the days in the order you enter them in, so if thats the case just go to the fields control source and re enter the days in correct order
if its from a table, perhaps you could try adding an extra number field, numbering the days 1-7, in correct order, then add that to the query that makes the drop down box, and sort smallest to largest, then all you have to do is hide the field from the combo box so other users cant see it, this can be done by either changing the number of columns, or the column length to 0cm,
 
Thanks guys, so the setup I have is

  • I have a table with a field in the table called "Day" and it is a "Short text"
  • I have a form which inputs into the field which is a Combo box and is a drop down with Monday to Friday
  • I have a report with the following Query
Code:
SELECT [Web Leads Table].Day, [Web Leads Table].[Date Received], [Web Leads Table].Name
FROM [Web Leads Table];

  • the report is set to group by "Day" but this never comes out in the order of the combo box which is used to enter the "Day"
  • The button used in a form to create the report uses the following code to filter the dates
Code:
Private Sub totallead_Click()
DoCmd.OpenReport ReportName:="Total Leads", View:=acViewPreview, _
     WhereCondition:="[Date Received] Between #" & Format(Me.txtFrom, "mm\/dd\/yyyy") & _
     "# And #" & Format(Me.txtTo, "mm\/dd\/yyyy") & "#"
End Sub
 
To get a Report to Sort and/or Group while in Design Mode of the Report on the Design Tab (hope you're using Access 2010) over to the left you will see Group & Sort. That where you set your Sorting.

FYI: Reports ignore the sorting done in a query.
 
Thanks. I have that. but it only lets me sort A on top or Z on top.

Is there no way to custom sort it?
 
No way to *custom* sort, you have to use the suggestion posted by Cowboy BeBe
 

Users who are viewing this thread

Back
Top Bottom