Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need form to filter, then print top 5

Status
Not open for further replies.

MikeTruscott

Technical User
Jun 26, 2003
35
GB
Hi all,
My access knowledge is very limited, and I can't figure out how to solve this.

Basically I have a table with, say, 7 columns and 1000 rows.
The table is full of numbers....what I want to do is to sort the values in each column (descending)....at the same time, so I can then see the top 5 values in each column.....at the same time.

Is there anyway of having all of the columns together, but unassociating them with the other columns so I can sort them?

The other way I've been trying to do this is by creating a form, so that you select what values you want to filter on and then the top 5 are found. I’d prefer to get a form to work…..but anything is better than nothing!

I've got 2 drop-down menus, called "Unit Find" and "PO Entry"
Then I copied 5 "values" boxes into the form.
My hope is that it will filter the table and fill the boxes with the values!!

My code is below, any help is greatly appreciated.

Mike

Private Sub Detail_Click()
On Error GoTo Err_Detail_Click

Me.Filter = "Division = " & Chr$(34) & Me.[Division Find] & Chr$(34) & "And AP Period = " & Chr$(34) & Me.[AP Find] & Chr$(34)
Me.FilterOn = True

Exit_Detail_Click:
Exit Sub
Err_Detail_Click:
MsgBox Err.Description
Resume Exit_Filter_Record_Click
End Sub
 
Mike,

I would do this by changing the rowsource in the form to ORDER BY and then requery. The SQL could then do the top five by

"SELECT TOP 5 * FORM ..... WHERE ... =... ORDER BY ...;"


rollie@bwsys.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top