I have a split form, that just displays the header and datasheet. It has a list of promotions. In it are two controls to that determines the diploma to be printed and if the diploma has been printed. I've added a button control to print the unprinted diplomas. Sure enough it prints just the unprinted diplomas however it doesn't necessarily print the correct diploma. Right now there are just two diplomas, but in the future there could be more so I don't want to have to modify the code each time a new diploma is added.
The code I have at the moment is:
Private Sub cmdPrintDiplomas_Click()
DoCmd.OpenReport Me.Diploma, acViewReport, , "[DiplomaPrinted] = " & 0, acWindowNormal
End Sub
I also would like it to change the DiplomaPrinted value after it has printed. I had added - Me.DiplomaPrinted = -1 - to the code but it gives me a runtime error -2147352567: You can't assign a value to this object. When I debug it highlight that line of code.
To sum up, my first objective is to print the unprinted diplomas with the correct diploma and my second is to change it's status to printed.
Any help is appreciated.