Dim i As Integer
'---------------------------------------------------------------------------
On Error GoTo FORMIRUEM_Error
'---------------------------------------------------------------------------
Set rs = New ADODB.Recordset
With rs
With .Fields
.Append "pp", adInteger
.Append "Name_", adChar, 255
.Append "ED", adChar, 255
.Append "Kol", adChar, 255
.Append "Price", adCurrency, 25
.Append "Summa", adCurrency, 25
End With
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.Open
For i = 0 To 6
If NZVB(Me!pp(i)) = "" Then Exit For
.AddNew
!pp = NZVB(Me!pp(i))
!NAME_ = NZVB(Me!NAME_(i))
!ED = NZVB(Me!ED(i))
!Kol = NZVB(Me!Kol(i))
!Price = NZVB(Me!Price(i))
!Summa = NZVB(Me!Summa(i))
Next i
.UpdateBatch 'без этого в форме не отобразиться
End With
Set DataReport1.DataSource = rs
If rs.RecordCount <> 0 Then
rs.MoveFirst
DataReport1.Sections("Section5").Controls("ITOG_KOL").Caption = _
"Количество наименований: " & rs.RecordCount
DataReport1.Sections("Section5").Controls("ITOG_SUMMA").Caption = _
"Всего по чеку: "
DataReport1.LeftMargin = 1
DataReport1.TopMargin = 1
'Printer.Orientation = 2
'показываем отчет
'If Me!LOKS1 <> 0 Then Call DataReport1.Show(vbModal)
'If Me!LOKS1 = 0 Then Call DataReport1.PrintReport(True, rptRangeAllPages)
Call DataReport1.Show(vbModal)
End If
|