Centar za edukaciju-BiH



#21 30.05.2016 13:00
Avko Van mreze
Administrator
Registrovan od:28.05.2014
Postovi:4,710


Predmet:Re: Problem Petlja
znaci nedostaje ovo:
----------------------------------------
23.05.2016 30.00
----------------------------------------

prije ovoga:

SVEUKUPNO : 273.00 KM

a jesi probao staviti ovo: Suma = Suma + rst!SumOfiznos
zivot je moja domovina.
Ovaj post je ureden 1 puta. Posljednja izmjena 30.05.2016 13:12 od strane Avko. ↑  ↓

#22 30.05.2016 13:15
nevsad Van mreze
Clan
Registrovan od:01.09.2010
Postovi:231


Predmet:Re: Problem Petlja
jesam
ovo treba sjesti i dobro rastabirit

mi smo mkrenuli putem

probaj probaj probaj

a
možda ****lje

kontaj kontaj pa probaj
↑  ↓

#23 30.05.2016 18:04
nevsad Van mreze
Clan
Registrovan od:01.09.2010
Postovi:231


Predmet:Re: Problem Petlja
ovo je rijesenje

Public Function taxaOddo()
Dim rst As DAO.Recordset
IzborPrintera
br = 1
izn = 0
siznos = 0
Suma = 0
kizlaz = 0
Close #1
Set rst = CurrentDb.OpenRecordset("KORISNIK")
'Open rst!Port For Output As #1
Open "C:\Temp\taxa.txt" For Output As #1
Print #1, strParPrint
Print #1, strIzbTrake
Print #1, strObSlova
Print #1, Tab(21 - Len(rst!korisnik)); rst!korisnik
Print #1, Tab(21 - Len(rst!adresa) - Len(rst!grad)); Nz(rst!adresa, ""); ","; Nz(rst!grad)
Print #1, "Izvjestaj o prodatim artiklima za period"
Print #1, Tab(7); "od"; Tab(10); Format(pocetni, "dd.mm.yyyy"); Tab(22); "do"; Tab(25); Format(krajnji, "dd.mm.yyyy")
Print #1, "========================================"
Print #1, " Datum Taxa Iznos"
Print #1, "========================================"
rst.Close
Set rst = CurrentDb.OpenRecordset("select * from Qzaperiod1 WHERE datum BETWEEN DATEVALUE('" & pocetni & "') AND DATEVALUE('" & krajnji & "')")
rst.MoveFirst
Datum = rst!Datum
Do Until rst.EOF
sif = rst!proizvod
im = rst!ime
izn = rst!SumOfiznos
If Datum <> rst!Datum Then
Print #1, "----------------------------------------"
Print #1, Datum; Tab(41 - Len(Format(siznos, "###0.00"))); Format(siznos, "###0.00")
Print #1, "----------------------------------------"
Suma = Suma + rst!SumOfiznos
siznos = 0
Datum = rst!Datum
End If
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")
siznos = siznos + rst!SumOfiznos
rst.MoveNext
Loop
Print #1, "----------------------------------------"
rst.MoveFirst
Suma = Suma + rst!SumOfiznos
If Datum <> rst!Datum Then
Print #1, Datum; Tab(41 - Len(Format(siznos, "###0.00"))); Format(siznos, "###0.00")
Print #1, "----------------------------------------"
End If
'****************
rst.MoveFirst
Suma = 0

Datum = rst!Datum
Do Until rst.EOF

Suma = Suma + rst!SumOfiznos
rst.MoveNext
Loop
rst.MoveFirst
Print #1, "SVEUKUPNO : "; Tab(41 - Len(Format(Suma, "###0.00"))); Format(Suma, "###0.00")
Print #1, "----------------------------------------"

Print #1, Chr(27) & Chr(100) & Chr(8)
Print #1, Chr(27) & Chr(105)
Close #1
End Function

hvala svima za pomoc
nevsad ramic
↑  ↓

#24 30.05.2016 21:47
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Postovi:10,612


Predmet:Re: Problem Petlja
PreuzmiIzvorni kd (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.
↑  ↓

#25 31.05.2016 07:42
nevsad Van mreze
Clan
Registrovan od:01.09.2010
Postovi:231


Predmet:Re: Problem Petlja
puno bolje, sa manje koda
fino hvala
nevsad ramic
↑  ↓

Stranice (3):1,2,3


Sva vremena su GMT +02:00. Trenutno vrijeme: 7: 29 pm.