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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Order By Code

Status
Not open for further replies.

SDS100UK

MIS
Jul 15, 2001
185
GB
Hi,

Does anyone know the vba for OrderBy?

I have 1 report that I want to open depending upon a sort order selected in a form.
I have a button and I want to say on click - open the report according to the sort order of the frame options box. I could use a number of reports but I would end up with many reports with different sorts.

It must be possible to set the Order By in VBA

Many thanks for your help

Steven
 
I don't know if this is the easiest way but it should work....

The Report have an Event called "Open" here you can in VBA do a criteria, that looks on your Frame optionbox.
something like:

Private Sub Report_Open(Cancel As Integer)
Select Case Forms!frm_Report_handler.Controls!Frame1.Value
Case 1
Me.OrderBy = "[Name]"
Case 2
Me.OrderBy = "[Date]"
Case 3
Me.OrderBy = "[Country]"
End Select
Me.OrderByOn = True
End Sub
Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 
Checkout the CreateGroupLevel function in the Help file. You basically create a Level to Sort or Group on for your specific report.

I hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top