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?
|