PC Review


Reply
Thread Tools Rate Thread

Code to track if a report was printed

 
 
=?Utf-8?B?Sk9N?=
Guest
Posts: n/a
 
      2nd Mar 2006
I would like to track the print status of a report, e.g., If I print a report
for record 1, I would like to know If I printed it and the date and time that
happened. Is that possible? and if possible, how do i do that?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      3rd Mar 2006
Not sure what you mean by record 1, but you can pass the record number using
the OpenArgs in the Report Open command line.
On the Close event of the report you can check the OpenArgs, and If 1 insert
the date it run to a table that keep track on printing this record

If Me.OpenArgs = 1 Then
Docmd.RunSql "INSERT INTO TableName ([Date Field Name]) VALUES (#"
& Now() & "#)"
End If
--
\\// Live Long and Prosper \\//
BS"D


"JOM" wrote:

> I would like to track the print status of a report, e.g., If I print a report
> for record 1, I would like to know If I printed it and the date and time that
> happened. Is that possible? and if possible, how do i do that?

 
Reply With Quote
 
=?Utf-8?B?Sk9N?=
Guest
Posts: n/a
 
      3rd Mar 2006
What I meant was that there could be several records in my DB, so If i print
a report belonging to record one, I would like to know when that
record/Records was/were printed

"Ofer" wrote:

> Not sure what you mean by record 1, but you can pass the record number using
> the OpenArgs in the Report Open command line.
> On the Close event of the report you can check the OpenArgs, and If 1 insert
> the date it run to a table that keep track on printing this record
>
> If Me.OpenArgs = 1 Then
> Docmd.RunSql "INSERT INTO TableName ([Date Field Name]) VALUES (#"
> & Now() & "#)"
> End If
> --
> \\// Live Long and Prosper \\//
> BS"D
>
>
> "JOM" wrote:
>
> > I would like to track the print status of a report, e.g., If I print a report
> > for record 1, I would like to know If I printed it and the date and time that
> > happened. Is that possible? and if possible, how do i do that?

 
Reply With Quote
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      3rd Mar 2006
In that case, on the OnFormat section where the records are printed write the
code

If Me.[FieldNameThatIndicateTheRecorNumber] = 1 Then
Docmd.RunSql "INSERT INTO TableName ([Date Field Name]) VALUES (#"
& Now() & "#)"
End If

--
\\// Live Long and Prosper \\//
BS"D


"JOM" wrote:

> What I meant was that there could be several records in my DB, so If i print
> a report belonging to record one, I would like to know when that
> record/Records was/were printed
>
> "Ofer" wrote:
>
> > Not sure what you mean by record 1, but you can pass the record number using
> > the OpenArgs in the Report Open command line.
> > On the Close event of the report you can check the OpenArgs, and If 1 insert
> > the date it run to a table that keep track on printing this record
> >
> > If Me.OpenArgs = 1 Then
> > Docmd.RunSql "INSERT INTO TableName ([Date Field Name]) VALUES (#"
> > & Now() & "#)"
> > End If
> > --
> > \\// Live Long and Prosper \\//
> > BS"D
> >
> >
> > "JOM" wrote:
> >
> > > I would like to track the print status of a report, e.g., If I print a report
> > > for record 1, I would like to know If I printed it and the date and time that
> > > happened. Is that possible? and if possible, how do i do that?

 
Reply With Quote
 
=?Utf-8?B?Sk9N?=
Guest
Posts: n/a
 
      8th Mar 2006
Ofer, I tried what you said, but I was not getting the date the report
printed in my table. Am I missing something?

This is what I did, i put the statments on my report's detail format

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.OpenArgs Then
DoCmd.RunSQL "INSERT INTO test2 ([PrintDtime]) VALUES (#" & Now() & "#)"
End If
End Sub

"Ofer" wrote:

> In that case, on the OnFormat section where the records are printed write the
> code
>
> If Me.[FieldNameThatIndicateTheRecorNumber] = 1 Then
> Docmd.RunSql "INSERT INTO TableName ([Date Field Name]) VALUES (#"
> & Now() & "#)"
> End If
>
> --
> \\// Live Long and Prosper \\//
> BS"D
>
>
> "JOM" wrote:
>
> > What I meant was that there could be several records in my DB, so If i print
> > a report belonging to record one, I would like to know when that
> > record/Records was/were printed
> >
> > "Ofer" wrote:
> >
> > > Not sure what you mean by record 1, but you can pass the record number using
> > > the OpenArgs in the Report Open command line.
> > > On the Close event of the report you can check the OpenArgs, and If 1 insert
> > > the date it run to a table that keep track on printing this record
> > >
> > > If Me.OpenArgs = 1 Then
> > > Docmd.RunSql "INSERT INTO TableName ([Date Field Name]) VALUES (#"
> > > & Now() & "#)"
> > > End If
> > > --
> > > \\// Live Long and Prosper \\//
> > > BS"D
> > >
> > >
> > > "JOM" wrote:
> > >
> > > > I would like to track the print status of a report, e.g., If I print a report
> > > > for record 1, I would like to know If I printed it and the date and time that
> > > > happened. Is that possible? and if possible, how do i do that?

 
Reply With Quote
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      8th Mar 2006
I'll try to give an example to what I mean.
==================================
If you want to track when a customer number 123 was printed, then on the
OnFormat event of the report use the code

If Me.[CustomerNumber] = 123 Then
Docmd.RunSql "INSERT INTO TableName ([Date Field Name]) VALUES (#"
& Now() & "#)"
End If
=================================
So, you need to change the criteria above to your criteria when you want to
track the printing

--
\\// Live Long and Prosper \\//
BS"D


"JOM" wrote:

> Ofer, I tried what you said, but I was not getting the date the report
> printed in my table. Am I missing something?
>
> This is what I did, i put the statments on my report's detail format
>
> Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
> If Me.OpenArgs Then
> DoCmd.RunSQL "INSERT INTO test2 ([PrintDtime]) VALUES (#" & Now() & "#)"
> End If
> End Sub
>
> "Ofer" wrote:
>
> > In that case, on the OnFormat section where the records are printed write the
> > code
> >
> > If Me.[FieldNameThatIndicateTheRecorNumber] = 1 Then
> > Docmd.RunSql "INSERT INTO TableName ([Date Field Name]) VALUES (#"
> > & Now() & "#)"
> > End If
> >
> > --
> > \\// Live Long and Prosper \\//
> > BS"D
> >
> >
> > "JOM" wrote:
> >
> > > What I meant was that there could be several records in my DB, so If i print
> > > a report belonging to record one, I would like to know when that
> > > record/Records was/were printed
> > >
> > > "Ofer" wrote:
> > >
> > > > Not sure what you mean by record 1, but you can pass the record number using
> > > > the OpenArgs in the Report Open command line.
> > > > On the Close event of the report you can check the OpenArgs, and If 1 insert
> > > > the date it run to a table that keep track on printing this record
> > > >
> > > > If Me.OpenArgs = 1 Then
> > > > Docmd.RunSql "INSERT INTO TableName ([Date Field Name]) VALUES (#"
> > > > & Now() & "#)"
> > > > End If
> > > > --
> > > > \\// Live Long and Prosper \\//
> > > > BS"D
> > > >
> > > >
> > > > "JOM" wrote:
> > > >
> > > > > I would like to track the print status of a report, e.g., If I print a report
> > > > > for record 1, I would like to know If I printed it and the date and time that
> > > > > happened. Is that possible? and if possible, how do i do that?

 
Reply With Quote
 
=?Utf-8?B?Sk9N?=
Guest
Posts: n/a
 
      9th Mar 2006
Ofer,
report does not have onformat event, I can only see open,close
activate,deactivate,no data, on page and error.... but the report header and
footer, and detail do have on format procedures....

I tried putting that statment in the on format procedure for the report
header and detail... but did not work...

"Ofer" wrote:

> I'll try to give an example to what I mean.
> ==================================
> If you want to track when a customer number 123 was printed, then on the
> OnFormat event of the report use the code
>
> If Me.[CustomerNumber] = 123 Then
> Docmd.RunSql "INSERT INTO TableName ([Date Field Name]) VALUES (#"
> & Now() & "#)"
> End If
> =================================
> So, you need to change the criteria above to your criteria when you want to
> track the printing
>
> --
> \\// Live Long and Prosper \\//
> BS"D
>
>
> "JOM" wrote:
>
> > Ofer, I tried what you said, but I was not getting the date the report
> > printed in my table. Am I missing something?
> >
> > This is what I did, i put the statments on my report's detail format
> >
> > Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
> > If Me.OpenArgs Then
> > DoCmd.RunSQL "INSERT INTO test2 ([PrintDtime]) VALUES (#" & Now() & "#)"
> > End If
> > End Sub
> >
> > "Ofer" wrote:
> >
> > > In that case, on the OnFormat section where the records are printed write the
> > > code
> > >
> > > If Me.[FieldNameThatIndicateTheRecorNumber] = 1 Then
> > > Docmd.RunSql "INSERT INTO TableName ([Date Field Name]) VALUES (#"
> > > & Now() & "#)"
> > > End If
> > >
> > > --
> > > \\// Live Long and Prosper \\//
> > > BS"D
> > >
> > >
> > > "JOM" wrote:
> > >
> > > > What I meant was that there could be several records in my DB, so If i print
> > > > a report belonging to record one, I would like to know when that
> > > > record/Records was/were printed
> > > >
> > > > "Ofer" wrote:
> > > >
> > > > > Not sure what you mean by record 1, but you can pass the record number using
> > > > > the OpenArgs in the Report Open command line.
> > > > > On the Close event of the report you can check the OpenArgs, and If 1 insert
> > > > > the date it run to a table that keep track on printing this record
> > > > >
> > > > > If Me.OpenArgs = 1 Then
> > > > > Docmd.RunSql "INSERT INTO TableName ([Date Field Name]) VALUES (#"
> > > > > & Now() & "#)"
> > > > > End If
> > > > > --
> > > > > \\// Live Long and Prosper \\//
> > > > > BS"D
> > > > >
> > > > >
> > > > > "JOM" wrote:
> > > > >
> > > > > > I would like to track the print status of a report, e.g., If I print a report
> > > > > > for record 1, I would like to know If I printed it and the date and time that
> > > > > > happened. Is that possible? and if possible, how do i do that?

 
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
how do i stop report being printed after each doc is printed JOEMC Microsoft Word Document Management 1 15th Feb 2010 10:19 PM
printed emails are not WSIWG. Code is printed vs. the actual text Nik Windows XP Print / Fax 1 17th May 2009 02:23 AM
How do I add printed list of track changes made to a document to . =?Utf-8?B?YyB0dW1vbG8=?= Microsoft Word Document Management 2 8th Jun 2007 03:09 AM
Pausing code until a report is printed =?Utf-8?B?SnVsaWVE?= Microsoft Access Form Coding 3 13th May 2005 05:27 AM
Laser Printed Pages Now Can Track You 'Like A License Plate' MrPepper11 Printers 30 8th Dec 2004 01:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:27 AM.