Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / June 2006

Tip: Looking for answers? Try searching our database.

OrderBy with multiple fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim Otero - 28 Jun 2006 09:42 GMT
I should be able to figure this one out, but it's late:

I'm trying to sort a report by two fields. I can do it easily if I
hard-code the fields. However, I want to get user input and store the
input in variables, which would then be used in the OrderBy method.
Right now it looks like this and is not working:

rptMember.OrderBy = strfield1, strfield2

What am I doing wrong? Any help would be greatly appreciated.

Thank you,

tim
Steve Schapel - 28 Jun 2006 20:18 GMT
Tim,

Never done this, so not sure, but you could try like this...
 rptMember.OrderBy = strfield1 & "," & strfield2
I also think it is important what event you are using for this.  I think
once the report is open it is too late to miodify data properties.  I
would try on the Open event of the report itself, in which case...
 Me.OrderBy = strfield1 & "," & strfield2

Signature

Steve Schapel, Microsoft Access MVP

> I should be able to figure this one out, but it's late:
>
[quoted text clipped - 10 lines]
>
> tim
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.