PC Review


Reply
Thread Tools Rate Thread

Re: alphabetical order of reports in a listbox

 
 
Duane Hookom
Guest
Posts: n/a
 
      14th Sep 2009
Try:
SELECT Mid([Name],4) As RptName
FROM MsysObjects
WHERE [Type] = -32764 AND Right([Name],3) IN ("rpt","rpf")
ORDER BY Mid([Name],4);

--
Duane Hookom
Microsoft Access MVP


"imstuck via AccessMonster.com" wrote:

> imstuck wrote:
> >i have this code on my list box:
> >This displays all the reports i have with "rpt" & "rpf" word at the beginning
> >of the report name.
> >
> >Private Sub Form_Open(Cancel As Integer)
> > Dim objAO As AccessObject
> > Dim objCP As Object
> > Dim strValues As String
> >Set objCP = Application.CurrentProject
> >For Each objAO In objCP.AllReports
> > If Left(objAO.Name, 3) = "rpt" Or Left(objAO.Name, 3) = "rpf" Then
> > strValues = strValues & Mid(objAO.Name, 4) & ";" & Left(objAO.Name, 3)
> >& ";"
> > End If
> >Next objAO
> >lstReports.RowSourceType = "Value List"
> >lstReports.RowSource = strValues
> >End Sub
> >
> >my problem is, i want to display the reports in alphabetical order. How can i
> >do that?
> >thanks

>
>
> i also tried this:
>
> SELECT [Name] FROM MsysObjects
> WHERE (([Type] = -32764) AND ([Name] Not Like "~*") AND ([Name] Not Like
> "MSys*"))
> ORDER BY [Name];
>
> --
> Message posted via http://www.accessmonster.com
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i re-order recipients (addressees) in alphabetical order? cj Microsoft Outlook Discussion 2 29th Jan 2010 02:57 PM
Moving listbox item from listbox to listbox Kevin Quigley Microsoft Dot NET 2 2nd Jun 2004 11:34 AM
burn songs in my order instead of alphabetical order, how? Waheeba Windows XP General 4 6th May 2004 09:58 PM
burn songs in my order instead of alphabetical order, how? Waheeba Windows XP Basics 1 6th May 2004 09:51 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Microsoft Excel Programming 0 22nd Oct 2003 12:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:15 AM.