Hello.
I have this code:
Works well to the line t1 = t1 + 123
Tells me This Item does Not Exist
I do not understand because in the Do-LOOP if you take the variables
[code] if len(trim(window3.textfield25.text))=0 then
msgbox(“No inserto las fechas”)
return
end if
if len(trim(window3.textfield26.text))=0 then
msgbox(“No inserto las fechas”)
return
end if
dim dato1,dato2 as string
dato1=mid(textfield25.text,7,4)+"-"+mid(textfield25.text,4,2)+"-"+mid(textfield25.text,1,2)
dato2=mid(textfield26.text,7,4)+"-"+mid(textfield26.text,4,2)+"-"+mid(textfield26.text,1,2)
Dim db As New ODBCDatabase
Dim t As TextOutputStream
Dim f As FolderItem
'Busco en la base de datos de ventas
db.DataSource = “Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\xojo_iva” + trim(label3.text)+".mdb" + “;Uid=Admin;Pwd=;”
If Not db.Connect Then
MsgBox “Error”
Close
else
dim t1,y,u,i,o,p,q,w,e as double =0
dim rs as recordset
rs=db.SQLSelect("SELECT * FROM ventas where fecha_comprobante Between #" + dato1 +"# AND #" + dato2 +"# order by fecha_comprobante asc")
if rs<>nil then
do until rs.eof
t1=t1+cdbl(rs.Field("importe_no_gravado").stringvalue)
y=y+cdbl(rs.Field("importe_no_cat").stringvalue)
u=u+cdbl(rs.Field("importe_op_exentas").stringvalue)
i=i+cdbl(rs.Field("importe_perc_imp_nac").stringvalue)
o=o+cdbl(rs.Field("importe_perc_imp_brutos").stringvalue)
p=p+cdbl(rs.Field("importe_perc_imp_mun").stringvalue)
q=q+cdbl(rs.Field("importe_imp_int").stringvalue)
w=w+cdbl(rs.Field("otros_tributos").stringvalue)
rs.movenext
loop
else
msgbox("No hay registros")
db.close
return
end if
End if
t1=t1+123 -------------------------------------------------------------->>>>Here Error ???
db.close[/code]
Edit (Paul): Added [code] tag to make code easier to read.