Prikazi cijelu temu 30.05.2016 21:47
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Lokacija:Tuzla


Predmet:Re: Problem Petlja
PreuzmiIzvorni kôd (Visual Basic):
  1. Public Function taxaOddo()
  2. Dim rst As DAO.Recordset
  3. IzborPrintera
  4. br = 1
  5. izn = 0
  6. siznos = 0
  7. Suma = 0
  8. Close #1
  9. Set rst = CurrentDb.OpenRecordset("KORISNIK")
  10. Open "C:\Temp\taxa.txt" For Output As #1
  11. Print #1, strParPrint
  12. Print #1, strIzbTrake
  13. Print #1, strObSlova
  14. Print #1, Tab(21 - Len(rst!korisnik)); rst!korisnik
  15. Print #1, Tab(21 - Len(rst!adresa) - Len(rst!grad)); Nz(rst!adresa, ""); ","; Nz(rst!grad)
  16. Print #1, "Izvjestaj o prodatim artiklima za period"
  17. Print #1, Tab(7); "od"; Tab(10); Format(Pocetni, "dd.mm.yyyy"); Tab(22); "do"; Tab(25); Format(Krajnji, "dd.mm.yyyy")
  18. Print #1, "========================================"
  19. Print #1, "    Datum                         Taxa                       Iznos"
  20. Print #1, "========================================"
  21. rst.Close
  22. Set rst = CurrentDb.OpenRecordset("select * from Qzaperiod1  WHERE datum BETWEEN DATEVALUE('" & Pocetni & "') AND DATEVALUE('" & Krajnji & "')")
  23. rst.MoveFirst
  24. Datum = rst!Datum
  25. Do Until rst.EOF
  26.    sif = rst!proizvod
  27.    im = rst!ime
  28.    izn = rst!SumOfiznos
  29.    Suma = Suma + izn
  30.         If Datum <> rst!Datum Then
  31.         Print #1, "----------------------------------------"
  32.         Print #1, Datum; Tab(41 - Len(Format(siznos, "###0.00"))); Format(siznos, "###0.00")
  33.         Print #1, "----------------------------------------"
  34.         siznos = 0
  35.         Datum = rst!Datum
  36.         End If
  37. Print #1, Format(rst!Datum, "dd.mm.yyyy"); "  "; sif; Tab(16); right(im, 24); Tab(41 - Len(Format(izn, "###0.00"))); Format(izn, "###0.00")
  38. siznos = siznos + rst!SumOfiznos
  39. rst.MoveNext
  40. Loop
  41.  Print #1, "----------------------------------------"
  42.  Print #1, Datum; Tab(41 - Len(Format(siznos, "###0.00"))); Format(siznos, "###0.00")
  43.  Print #1, "----------------------------------------"
  44.       Print #1, "SVEUKUPNO :            "; Tab(41 - Len(Format(Suma, "####0.00"))); Format(Suma, "####0.00")
  45.       Print #1, "----------------------------------------"
  46. Print #1, Chr(27) & Chr(100) & Chr(8)
  47. Print #1, Chr(27) & Chr(105)
  48. Close #1
  49.  End Function

Podrška samo putem foruma, jer samo tako i ostali imaju koristi od toga.