sorting options

raymond3090

Registered User.
Local time
Today, 18:07
Joined
Sep 5, 2002
Messages
43
Hi,

I currently have a form with many fields for user input. These fields are used as searching criteria to narrow down results that my query returns.

I would also like to give the user the option to browse the records that the query returns, with the records sorted by a particular field chosen by the user.

I can picture a combo box with the label 'Sort By:'. Inside the combo box would be a list of all fields that could be sorted in my query. I have no idea how to accomplish this! Help!!

thanks!
Ray
 
Build the sql string which is the row source for the report.

Use the QBE frame to get the proper context.

Not that query criteria must be set off in quotes, e.g.

dim strSQL as string
strSQL = "SELECT * FROM tbTable WHERE [ClientID]" & me!cboClientID
docmd.openreport "rptReportName"
Reports!rptReportName.Rowsource=strSQL
Reports!rptReportName.Requery

This is an oversimplification, but the geeneral idea.
 

Users who are viewing this thread

Back
Top Bottom