U izvestaju KEPU koji sam formirao na osnovu union query-ja u kome spajam podatke iz tabela UvoznaKalkulacija, Prijemnica, RacunOtpremnica, InternaOtpremnica i Povratnica, imam sledeci kod :
Option Compare Database
Dim Zbir1
Dim Zbir2
Dim Zbir3
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
rb.Caption = rb.Caption + 1
Zbir1 = Zbir1 + Zaduzenje.Text
Zbir2 = Zbir2 + Razduzenje.Text
Zbir3 = Zbir3 + Saldo.Text
End Sub
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
SumaZaduzenja.Caption = Format(Zbir1, "#,##0.00")
SumaRazduzenja.Caption = Format(Zbir2, "#,##0.00")
SumaSaldo.Caption = Format(Zbir3, "#,##0.00")
End Sub
Private Sub ReportHeader_Print(Cancel As Integer, PrintCount As Integer)
rb.Caption = 0
Zbir1 = 0
Zbir2 = 0
Zbir3 = 0
End Sub
Ovim kodom vrsim sumiranje po svakoj strani i kumulativno sumiranje celog izvestaja. Sve radi bez problema dok u svim tabelama imam podatke. Medjutim, ukoliko bar u jednoj od njih nema podataka (recimo da jos nije izdat nijedan racun) pri otvaranju izvestaja u print preview modu dobijam sledecu gresku:
Run-time error '2185'
You can't reference a property or method for a control unless the control has the focus.
Naravno u report view modu izvestaj se otvara ali se kod ne izvrsava.
U cemu je problem ?
Option Compare Database
Dim Zbir1
Dim Zbir2
Dim Zbir3
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
rb.Caption = rb.Caption + 1
Zbir1 = Zbir1 + Zaduzenje.Text
Zbir2 = Zbir2 + Razduzenje.Text
Zbir3 = Zbir3 + Saldo.Text
End Sub
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
SumaZaduzenja.Caption = Format(Zbir1, "#,##0.00")
SumaRazduzenja.Caption = Format(Zbir2, "#,##0.00")
SumaSaldo.Caption = Format(Zbir3, "#,##0.00")
End Sub
Private Sub ReportHeader_Print(Cancel As Integer, PrintCount As Integer)
rb.Caption = 0
Zbir1 = 0
Zbir2 = 0
Zbir3 = 0
End Sub
Ovim kodom vrsim sumiranje po svakoj strani i kumulativno sumiranje celog izvestaja. Sve radi bez problema dok u svim tabelama imam podatke. Medjutim, ukoliko bar u jednoj od njih nema podataka (recimo da jos nije izdat nijedan racun) pri otvaranju izvestaja u print preview modu dobijam sledecu gresku:
Run-time error '2185'
You can't reference a property or method for a control unless the control has the focus.
Naravno u report view modu izvestaj se otvara ali se kod ne izvrsava.
U cemu je problem ?