"Jimmy" <do**@email.mewrote in
news:Qe*********************@fe08.news.easynews.co m:
Is there a way to sort/group a report based on the second
column of a combo box, i.e. the text associated with the
primary key number?
very easy.
Open report in design view. Open (if not already) the properties
popup.
Select the recordsource property from the data tab.
Click the elipsis (...) button. If the existing recordset is a
table you will be prompted "do you want to create a query based
on the table?". Say yes, or if the recordset is already a
query,.the query design tool will open.
Add the table which is the source for the combobox.
Create a join by dragging the cursor from the primary key of the
lookup table to the relevand foreign key in the other table if
it didn't show automatically.
Double-click the field name for your text to put it in the
fields section of the query builder.
Set the sort to ascending. Drag this column to the left so it's
the first column in the grid.
Close the query builder.
Click on the sorting/grouping icon in the Report toolbar.
Select the column you just added in the top combobox.
Turn on group header and/or footer as required.
Close the Sorting and Grouping popup.
Save the form.
It's actually faster to do than to describe.
--
Bob Quintal
PA is y I've altered my email address.
--
Posted via a free Usenet account from
http://www.teranews.com