PC Review


Reply
Thread Tools Rate Thread

Count times report opened

 
 
=?Utf-8?B?QmFycnk=?=
Guest
Posts: n/a
 
      12th Oct 2006
I need to create a table that will log every time a report is opened so i
have a log showing which reports are being used and which are not.

Anyone have any ideas?
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      12th Oct 2006
Create a table, and put code in the report's Open event to update that
table.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Barry" <(E-Mail Removed)> wrote in message
news:22EADF3B-167E-4194-BC8A-(E-Mail Removed)...
>I need to create a table that will log every time a report is opened so i
> have a log showing which reports are being used and which are not.
>
> Anyone have any ideas?



 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgSGliYnM=?=
Guest
Posts: n/a
 
      12th Oct 2006
As Douglas says above but just in case you need a bit more info here is what
I use.

First create a new table call tblActivity with fields :-
ObjectName (Text, Size=255, Indexed=Yes(No Duplicates)
ObjectTitle (Text, Size=255)
FirstDate (Date/Time)
LastDate (Date/Time)
Counter (Number, Long Integer)

Next paste the following Sub-Routine into a module.

'-----------------------------------------------------------------------
Public Sub UpdateActivity(vObjectName As String, vObjectTitle As String)

'Update tblActivity with new data or create new record if first time object
used
'Entry (vObjectName) = name of object (frmOrders, rptInvoice, etc)
' (vObjectTitle) = title of object (Orders form, Invoice, etc)
'Exit New record added or existing record updated in tblActivity

Dim vTitle As String

If vObjectTitle = "" Then vTitle = vObjectName Else vTitle =
vObjectTitle 'if no 'Caption' then use Object name
If Nz(DLookup("ObjectName", "tblActivity", "ObjectName = '" &
vObjectName & "'")) = "" Then 'if record does NOT exist then
CurrentDb.Execute "INSERT INTO tblActivity (ObjectName, ObjectTitle,
FirstDate, " _
& "LastDate, Counter) VALUES (" _
& "'" & vObjectName & "', " _
& "'" & vTitle & "', " _
& "Date(), " _
& "Date(), " _
& "1)"
'create new record
Else
CurrentDb.Execute "UPDATE tblActivity SET Counter = Counter + 1,
LastDate = Date() " _
& "WHERE ObjectName = '" & vObjectName & "'"
'update existing record
End If

End Sub
'--------------------------------------------------------------------------

Now copy this line into the Open event of all forms and reports (but NOT
subForms or subReports) :-

UpdateActivity Name, Caption

Whenever a form or report is opened a new record will be added to the table
or an existing record updated with the current date and the counter field
incremented by one. You can then easily create a report or form to display
the saved data.

Please let us know if that was useful, it may help others.
--
Peter Hibbs


"Douglas J. Steele" wrote:

> Create a table, and put code in the report's Open event to update that
> table.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "Barry" <(E-Mail Removed)> wrote in message
> news:22EADF3B-167E-4194-BC8A-(E-Mail Removed)...
> >I need to create a table that will log every time a report is opened so i
> > have a log showing which reports are being used and which are not.
> >
> > Anyone have any ideas?

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Count numbers of times workbook opened =?Utf-8?B?SmltIFRob21saW5zb24=?= Microsoft Excel Programming 3 15th Jul 2009 07:50 PM
Can Outlook count number of times email was opened by recipient? mke_srba Microsoft Outlook Discussion 1 18th Jul 2008 05:32 AM
I need to be able to count the no. of times a sprdsheet is opened =?Utf-8?B?TWVsdmluIFA=?= Microsoft Excel Misc 2 22nd Jan 2007 11:16 AM
Count the times a file is opened mrlanier@hotmail.com Microsoft Excel Programming 4 22nd Dec 2006 06:11 AM
Is it possible to count how many times a spreadsheet is opened ceepee Microsoft Excel Misc 2 2nd Apr 2004 02:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:36 PM.