473,387 Members | 1,621 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,387 software developers and data experts.

Using orderby with multiple fields

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
Jun 28 '06 #1
2 26822
For a report, anything in its Sorting And Grouping dialog will override the
OrderBy property.

You can reassign the ControlSource of the GroupLevel, as shown here:
Sorting Records in a Report at run-time
at:
http://allenbrowne.com/ser-33.html

If you do want to assign the OrderBy, enclose the field names in quotes, and
don't forget to set OrderByOn. Typically this would go in the Open event of
the report:
Me.OrderBy = "[SomeField], [AnotherField]"
Me.OrderByOn = True

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"tim otero" <ti******@msn.com> wrote in message
news:JL*********************@newssvr13.news.prodig y.com...
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

Jun 28 '06 #2

rptMember.OrderBy = "[" & strfield1 & "], [" & strfield2 & "]"
--

Terry Kreft
"tim otero" <ti******@msn.com> wrote in message
news:JL*********************@newssvr13.news.prodig y.com...
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

Jun 28 '06 #3

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

Similar topics

1
by: mark.reichman | last post by:
First off.. Thanks to Grant Wagner for help in a previous thread related to this one. I am at a total loss... I have multiple fields in a form with the same name. Lets call the fields with the...
2
by: PPT33R | last post by:
The MS Access website is very unhelpful on this topic, and I cannot find anything in my Googling to find a hint. I am working with very large, existing data sets that consist of multiple fields....
3
by: tesc | last post by:
I am so aggravated and need any help I can get. I am using Access 2000 and am trying to sort multiple fields in a select query. My query is set up as follows: FIELD 1 FIELD 2 FIELD 3 ...
5
by: JP SIngh | last post by:
Hi All This is a complicated one, not for the faint hearted :) :) :) Please help if you can how to achieve this search. We have a freetext search entry box to allow users to search the...
3
by: mkjets | last post by:
I have worked for hours on trying to find a solution and have not figured it out. I am working in Access 2003. I need to create a query that takes values from 1 table and displays them in...
4
4Him
by: 4Him | last post by:
First off, let me say this is a great site! I've just started working with Access and much of my success is from what I've read here! Background: I have a form, driven off a single table. Goal:...
2
by: Nathan Sokalski | last post by:
I have a Repeater that uses a DataSource that has multiple fields. When the values of these fields is displayed in the Repeater, there are fields that are used in combination with other fields as...
7
by: john.cole | last post by:
I have searched all the groups I can, and I still haven't been able to come up the solution I need. I have the following problem. In my form named sbfrmSpoolList, I am entering a job, spool and...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
2
by: Horace Martin | last post by:
How do I populate multiple fields on a form by using a combo box. My combo box has 3 col. When I make a selection from my combo box all 3 fields should be filled in on my form. eg. Form Fields:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.