Greetings
Dont have much coding experience and am hoping that there is a relatively straight forward solution. Have been trying to get it resolved for some time now, without success.
Using Access 2003.
Have a sub report, based on a crosstab. Some of the controls on the sub report are unbound and they get their values from an On Open event.
This works fine when I open the sub report on its own. But when I try open the main report, which contains the subreport, get an error 2191 ie "you cant set the control source property in print preview or after printing has started".
The On Open code is
Private Sub Report_Open(Cancel As Integer)
Dim IntI As Integer
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("select * from QryRxAudit")
rs.MoveLast
rs.MoveFirst
For IntI = 1 To rs.RecordCount
Me("Col" & IntI).ControlSource = rs("RxAuditID")
Me("TotalCol" & IntI).ControlSource = "=Sum([" & rs("RxAuditID") & "])" & "/" & ("SumTotalOfNumberAuditID")
rs.MoveNext
Next IntI
End Sub
Hope you can help
Thank you.
Dont have much coding experience and am hoping that there is a relatively straight forward solution. Have been trying to get it resolved for some time now, without success.
Using Access 2003.
Have a sub report, based on a crosstab. Some of the controls on the sub report are unbound and they get their values from an On Open event.
This works fine when I open the sub report on its own. But when I try open the main report, which contains the subreport, get an error 2191 ie "you cant set the control source property in print preview or after printing has started".
The On Open code is
Private Sub Report_Open(Cancel As Integer)
Dim IntI As Integer
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("select * from QryRxAudit")
rs.MoveLast
rs.MoveFirst
For IntI = 1 To rs.RecordCount
Me("Col" & IntI).ControlSource = rs("RxAuditID")
Me("TotalCol" & IntI).ControlSource = "=Sum([" & rs("RxAuditID") & "])" & "/" & ("SumTotalOfNumberAuditID")
rs.MoveNext
Next IntI
End Sub
Hope you can help
Thank you.