get Access report properties using a VB app?
Posted on 2002-04-21
below i have included some code that worked in Access, but i am not sure how i can do the same thing in my visual basic application ?????
i am currently connecting to a access database via ADO and get data from a table....but i would also like to get the sortby,groupby values from the reports in the access database?
Dim frm As Form, prp As Property 'rpt As Report
Dim obj As AccessObject, dbs As Object
Dim GrpOn, Grpkeeptog, GrpInterval
Dim i As Long
Dim rptgrouplevel As String
Dim isGroupLevel As Variant
'set the dbs to the current application, which in this case is a access database
Set dbs = Application.CurrentProject
'For each report in the database
For Each obj In dbs.AllReports
DoCmd.OpenReport obj.Name, acViewDesign
If obj.IsLoaded = True Then
'Identifies the sort order for each field
For i = 0 To 9
'If not((reports(0).grouplevel(i)) isnothing) then 'not work!!!
If (reports(0).grouplevel(i).SortOrder) = False Then
MsgBox ("The Field " + Str(i) + " is in Descending Order")
MsgBox ("The Field " + Str(i) + " is in Ascending Order")
DoCmd.Close acReport, obj.Name, acSaveNo