Set Boolean field to true after printing... (1 Viewer)

dazza61

Registered User.
Local time
Today, 20:55
Joined
Feb 7, 2006
Messages
60
Hi guys,

I have a report with a subreport...

One of the fields in the subreport is a boolean field called 'Printed'

I've tried setting this field to 'True' in the OnPrint and On Format events of the detail section (which is where the 'Printed' field is placed) but I keep getting an Error 2448 message aka 'You can't assign a value to this object'...

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me!Printed = True
End Sub

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Me!Printed = True
End Sub


How can I set a field in the subreport to true after it is printed?

Many thanks in advance

dazza61
 
R

Rich

Guest
Use an update query, but then since you can never be 100% that a report has actually printed you'd be better using a msg box to confirm the update
 

dazza61

Registered User.
Local time
Today, 20:55
Joined
Feb 7, 2006
Messages
60
Thanks for the reply Rich - been away a while hence my delay...

I totally agree with the present message box as it covers if the printer screws up (out of ink, paper jam, etc)...but I'm still stuck...

I pull all unprinted timesheets (using a query) into a report/subreport combo that you can flick through with record selectors. An 'isprinted' field is held in the subreport...(there is a reason for this - I wish it could be held in the main table but it has to be held in the many table because some timesheets contain ONE employee and some contain MANY employees in the subreport section (customer requirements sadly))...

I would like to pull the Timesheet ID off the main record every time I select a new record - if I could do this I could send this ID to an update query to update the isprinted field in the MANY timesheet items table...

I've tried OnPrint but it simply pulls the ID of the last timesheet that is displayed...

Any ideas would be appreciated - even a different approach

Many thanks in advance

dazza61
 

Users who are viewing this thread

Top Bottom