vb123.com

Garry Robinson's Popular MS Access, Office and VB Resource Site

 

Home  Contact Us
Order our Software

RSS & Newsletter  
Join our XML/RSS Newsfeed or sign up for our informative newsletter on Office Automation, Access and VB topics
Read More

Get Good Help
If you need help with a database, our Professionals could be the answer
Read More

  Is Your Database Corrupt ?
If you have a corrupt database, Try our Access Recovery service

The Workbench  Find out who has your database open, start the correct version of Access, easy compacting and backups, change startup options, mde compile,  shutdown database Read and Download

The Toolshed 
Searchable help file comprising of all the information at vb123.com plus hidden downloads etc. Read More



The Toolbox

Libraries of software that we regularly import into our projects. This is a newer version of the Toolshed More..


Access >>> SQL 
Upsize to SQL Server 2005 or 2008, easily repeated conversions, highly accurate SQL query
translation and web form conversion.
Read More

SharePoint
For our company file sharing and task management, we use
SharePointHosting

DryToast 
Backup and query your BaseCamp
® projects
Read More


Datamining/Graphs

Explore your data with this versatile graphing and data mining shareware tool.  Read More

Garry's Blog
Find out a few other things that Garry has been writing about Microsoft Access. Read more

About The Editor Garry Robinson writes for a number of popular computer magazines, is now a book author and has worked on 100+ Access databases. He is based in Sydney, Australia
Contact Us ...

Search ...

or try our new site built with SharePoint Designer
 vb123.com.au
 

 

Next Tip    An example of quickly checking a Report Property for all Reports

By Adam Cogan


I found that some of the reports in a customers database were giving error.  I tracked it down to the 'RecordLock' property being set to 'All Records'. I quickly wanted to see what other reports also had that setting, but there were more than 200 reports in the database. You can use this function to check any other report property.

Function CheckReportProperties(strProperty As String) As String

  ' Comments   : gets all the names of reports in the current database
  ' Parameters : strIn - string to populate
  '               chrDelimit - character to use as a delimiter
  ' Returns    : number of reports

On Error GoTo PROC_ERR

Dim dbsCurrent As Database
Dim conTmp As Container

Set dbsCurrent = CurrentDb()
Set conTmp = dbsCurrent.Containers("reports")

Dim intCount As Integer
Dim docTmp As Document
'Dim strName As String
Dim strIn As String
Dim chrDelimit As String
Dim bolNeedsClosing As Boolean
Dim rptTmp As Report
Dim strName As String

intCount = conTmp.Documents.Count

For Each docTmp In conTmp.Documents
    strName = docTmp.Name
    'check for properties here
    'if the report is closed then open it in design view

    If SysCmd(acSysCmdGetObjectState, acReport, strName) <> acObjStateOpen
Then
        DoCmd.OpenReport strName, acDesign
        bolNeedsClosing = True
    End If

    Set rptTmp = Reports(strName)
    strIn = strIn & vbCrLf & strName & "   -    " & rptTmp.Properties(strProperty).Name & "   -    " &
rptTmp.Properties(strProperty).Value
    'close any open reports
    If bolNeedsClosing Then DoCmd.Close acReport, strName

Next docTmp

CheckReportProperties = strIn

PROC_EXIT:
  Exit Function
PROC_ERR:
  CheckReportProperties = 0
  Resume PROC_EXIT
End Function
 

As an example open Northwind.mdb and the hit Ctl+G for the Debug window.
Then type this.....

? CheckReportProperties("RecordLocks")

Alphabetical List of Products   

   RecordLocks   

Catalog   

   RecordLocks   

Customer Labels   

   RecordLocks   

Employee Sales by Country   

   RecordLocks   

Invoice   

   RecordLocks   

Products by Category   

   RecordLocks   

Sales by Category   

   RecordLocks   

Sales by Category Subreport   

   RecordLocks   

Sales by Year   

   RecordLocks   

Sales by Year Subreport   

   RecordLocks   

Sales Totals by Amount   

   RecordLocks   

Summary of Sales by Quarter   

   RecordLocks   

Summary of Sales by Year   

   RecordLocks   


This message comes to you courtesy of SSW who can be found at http://www.ssw.com.au

Published  1999-07

 

Links >>>  Home | Search | Workbench | Orders | Newsletter | Access Security | Access professionals