Modifying sort attrribute thru a combo box

J

john johndon

I have a form with a combo box, which I want to use to select which field
the query is sorted by....

If thats not clear, the combo boc has field1, field2, field3...after
selecting one of those, I hit the report button on the the form and the
report is generated, with the data sorted (ascending) by the field I
selected in the combo box....any ideas.

TIA
 
D

Duane Hookom

Make the row source of the query into 2 columns and bind to the first column
1,Field1,2,Field2,3,Field3,...
Then create a column in your query:
SortBy: Choose(Forms!frmA!cboFields, [Field1], [Field2], [Field3],...)
Set the sort to Ascending and use this calculated field in the report
sorting and grouping (if used in report).
 
J

john johndon

Duane

Thanks for replying. I am fairly new at Acccess, so can you be a little more
explicit in what you are suggesting I do....

I don't understand the part regarding make the row source into two columns
and bind to the first column 1, Field one....etc

thanks


Paul

Duane Hookom said:
Make the row source of the query into 2 columns and bind to the first column
1,Field1,2,Field2,3,Field3,...
Then create a column in your query:
SortBy: Choose(Forms!frmA!cboFields, [Field1], [Field2], [Field3],...)
Set the sort to Ascending and use this calculated field in the report
sorting and grouping (if used in report).
--
Duane Hookom
MS Access MVP


john johndon said:
I have a form with a combo box, which I want to use to select which field
the query is sorted by....

If thats not clear, the combo boc has field1, field2, field3...after
selecting one of those, I hit the report button on the the form and the
report is generated, with the data sorted (ascending) by the field I
selected in the combo box....any ideas.

TIA
 
J

John Johndon

Duane

Thanks for your answer...but I am a bit of a newbe with
respect to access....can your fill in some details in
your answer please...

Thanks

JJ
-----Original Message-----
Make the row source of the query into 2 columns and bind to the first column
1,Field1,2,Field2,3,Field3,...
Then create a column in your query:
SortBy: Choose(Forms!frmA!cboFields, [Field1], [Field2], [Field3],...)
Set the sort to Ascending and use this calculated field in the report
sorting and grouping (if used in report).
--
Duane Hookom
MS Access MVP


john johndon said:
I have a form with a combo box, which I want to use to select which field
the query is sorted by....

If thats not clear, the combo boc has field1, field2, field3...after
selecting one of those, I hit the report button on the the form and the
report is generated, with the data sorted (ascending) by the field I
selected in the combo box....any ideas.

TIA


.
 
D

Duane Hookom

Your combo box has a row source. I assume your row source type is value
list. I gave you the new values for the row source. Also, set the number of
columns to 2 and the bound column to 1. These are all properties of the
combo box.

--
Duane Hookom
MS Access MVP


john johndon said:
Duane

Thanks for replying. I am fairly new at Acccess, so can you be a little more
explicit in what you are suggesting I do....

I don't understand the part regarding make the row source into two columns
and bind to the first column 1, Field one....etc

thanks


Paul

Duane Hookom said:
Make the row source of the query into 2 columns and bind to the first column
1,Field1,2,Field2,3,Field3,...
Then create a column in your query:
SortBy: Choose(Forms!frmA!cboFields, [Field1], [Field2], [Field3],...)
Set the sort to Ascending and use this calculated field in the report
sorting and grouping (if used in report).
--
Duane Hookom
MS Access MVP


john johndon said:
I have a form with a combo box, which I want to use to select which field
the query is sorted by....

If thats not clear, the combo boc has field1, field2, field3...after
selecting one of those, I hit the report button on the the form and the
report is generated, with the data sorted (ascending) by the field I
selected in the combo box....any ideas.

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top