Private Sub cmdcon_Click()
Dim MITEXTO, clte, cia As String
sql = "Select nomclt, dirclt, telclt, nomcia, dircia, telcia, logocia, "
sql = sql & "Identificacion, Itemprof, Cantprof, Preprof, Fecprof, Fe2prof, Garprof, Tenprof, Fpaprof, Ivaprof, Desprof, "
sql = sql & "cantprof * preprof as SubTotal, Subtotal * ivaprof/100 as iva, Subtotal * desprof/100 as descu, Subtotal + Iva - Descu as TOTAL "
sql = sql & "from tcia as a, tclt as b, tprof as c " 'aumentar los otros
sql = sql & " where a.idcia = c.idcia and b.idclt = c.idclt and Idprof = " & Num
'MsgBox SQL
Rs.Open sql, conexion
'SACO LA CANTIDAD EN LETRAS
MITEXTO = LetrDOLARES(Rs(21)) ' cantidad en letras con funcion
'***saco las id de la cia y del clte
ssql = "select idcia, idclt from tprof where idprof = " & Num
Rstj.Open ssql, conexion
cia = Rstj(0)
clte = Rstj(1)
If chklogo.Value = 1 Then
'linea para colocar el texto en el data
drptIndl.Sections("Seccion1").Controls.Item("etqcl").Caption = MITEXTO
drptIndl.Sections("Seccion1").Controls.Item("etqclte").Caption = clte
drptIndl.Sections("Seccion1").Controls.Item("etqcia").Caption = cia
drptIndl.Sections("Seccion1").Controls.Item("etqidprof").Caption = Num
Set drptIndl.Sections("Seccion1").Controls.Item("logo1").Picture = LoadPicture("C:\Ag2\vbleo\FLPOS\Img\AGLOGO.jpg") 'LoadPicture(Rs(6))
Set drptIndl.DataSource = Rs
drptIndl.Show
Else
'linea para colocar el texto en el data
drptInd.Sections("Seccion1").Controls.Item("etqcl").Caption = MITEXTO
drptInd.Sections("Seccion1").Controls.Item("etqclte").Caption = clte
drptInd.Sections("Seccion1").Controls.Item("etqcia").Caption = cia
drptInd.Sections("Seccion1").Controls.Item("etqidprof").Caption = Num
'***************************************
'*Ojo esto se lo quito a solicitud de la empresa.
'Set drptInd.Sections("Seccion1").Controls.Item("logo1").Picture = LoadPicture(Rs(6))
'****************************************
Set drptInd.DataSource = Rs