Programmatically control Report Grouping & Sorting via Form

JenSGT

Registered User.
Local time
Today, 04:45
Joined
Jul 26, 2009
Messages
20
I have a form with combo boxes & textboxes as input selections to generate a report. At the same time, I would like to give User the flexibility to do sorting and grouping on the report by opening a mini form that will use option buttons to indicate which field is being selected by User to do sorting and grouping.
Based on User selection, the report will be generated accordingly.

How do I pass the form parameters to the report before it generates the data?

TKQ IA....
 
When the report opens it can read information from the form.
Code:
Private Sub Report_Open(Cancel as Integer)
[COLOR="Green"]  'reference the calling form[/COLOR]
  With Forms("CallingForm")
[COLOR="Green"]    'prove that we can read and use properties of the form[/COLOR]
    MsgBox "Calling Form Name: " & .Name
  End With
End Sub
 
Thanks, I use the form's custom property to pass the data to the report.

Another Question:
Can we create the sort level (ie. Grouplevel (2) which is third level sort) using VBA?

I would like my form to be a bit dynamic in the sense that User can choose to sort by 1 level, 2 levels or 3 levels.

If level 1 is chosen, then level 2 and level 3 be turned off in the report.
If level 1 & level 2 is chosen, level 3 will be turned off in the report.

Is there a way in VBA to create and delete sort levels in the open report event?
 

Users who are viewing this thread

Back
Top Bottom