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

open a report from continues form 1

Status
Not open for further replies.

smayshar

Programmer
Aug 30, 2003
42
0
0
AU
I have several continues forms and one general toolbar for all these forms that contain ms filter , a-z sorting ...
each one of the forms have a print button that opens a report.

how can i open the report with the same sorting that the user chose on the form ?

the filter works fine with the call :

DoCmd.OpenReport stDocName, acPreview, , Me.Filter
I itried : DoCmd.OpenReport stDocName, acPreview, Me.Filter - didn't work
 
Have you checked the Sorting/Grouping properties of you report? When in design mode, right-click the upper-left-most square and open the dialog box. There, add the field that you wish to sort by, be it the name, record number or whatever, then ascending or descending.

Hope this helps!
 
How are ya smayshar . . . . .

In the [blue]Open event[/blue] of one of the reports try this ([blue]you[/blue] substitute proper form names in [purple]purple[/purple]):
Code:
[blue]   Dim Prp As Property
   
   Set Prp = Forms![purple][b]CallingFormName[/b][/purple].Properties("OrderBy")
   
   If Trim(Prp & "") <> "" Then
      Me.OrderBy = Prp
      Me.OrderByOn = True
   End If
   
   Set Prp = Nothing[/blue]
When your satisified, do the others . . . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top