Question : New issue with report run counter not incrementing by 1

A week or so ago someone helped me with a run counter incrementing by 1 every time the reporet was launched.  For some reason it has stopped working.

Here is the code I was provided.  Have I somehow broken something?

On Open Event:  
nextno = DLookup("RunCounter", "tblReports", "ReportName ='" & Me.Name & "'") + 1

Report Header Format Event:
Me.txtReportNumber = nextno

Report Footer Print Event:
CurrentDb.Execute "Update tblreports set RunCounter= " & nextno & " where ReportName ='" & Me.rptProdSkedRptGrpdByMoldSec & "'", dbFailOnError

Answer : New issue with report run counter not incrementing by 1

The code you posted here has never worked.  You must have changed it from the working version.

This command is wrong.

CurrentDb.Execute "Update tblreports set RunCounter= " & nextno & " where ReportName ='" & Me.rptProdSkedRptGrpdByMoldSec & "'", dbFailOnError

It should be either..
CurrentDb.Execute "Update tblreports set RunCounter= " & nextno & " where ReportName = 'rptProdSkedRptGrpdByMoldSec'", dbFailOnError

or

CurrentDb.Execute "Update tblreports set RunCounter= " & nextno & " where ReportName ='" & Me.Name & "'", dbFailOnError

 

Random Solutions  
 
programming4us programming4us