grilla de facturacion

ipla
04 de Mayo del 2004
c NUMERO
Public PED
Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text26.Text = ""


End Sub

Private Sub Command2_Click()
Dim res As Byte
res = MsgBox("Desea Imprimir la Factura", vbYesNo, "Aviso")
If res = 6 Then
Form15.PrintForm
End If
End Sub

Private Sub Form_Load()

Combo2.AddItem "Pesos"
Combo2.AddItem "Dolar"
Combo2.AddItem "Euro"

Set basedato = Workspaces(0).OpenDatabase(App.Path & "BD1.mdb")
Form15.WindowState = 2


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text26.Text = ""


Text9.Text = (Date)
End Sub

Private Sub Text17_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then


If Len(Trim$(Me.Text17)) = 0 Then
MsgBox "Debe ingresar un Nombre Cliente", vbInformation, "Atención"
Exit Sub
End If

SQL = "select * from Datos_Clientes where CLIENTE = '" + Text17 + "';"
Set registro = basedato.OpenRecordset(SQL, dbOpenDynaset)

If registro.RecordCount <> 0 Then

Text10.Text = registro!CADENA
Text19.Text = registro!VENDEDOR
Text11.Text = registro!SECTOR
Text12.Text = registro!REFERENCIA
Text13.Text = registro!COMUNA
Text14.Text = registro!RESTRICCION

Else
MsgBox ("No hay registro"), vbInformation, "Atención"

End If






SQL = "select * from Datos_Pedidos where CLIENTE = '" + Text17 + "';"
Set registro = basedato.OpenRecordset(SQL, dbOpenDynaset)

If registro.RecordCount <> 0 Then

Text16.Text = registro!FACTURA
Text21.Text = registro!VALOR_FACTURA
Text22.Text = registro!NOTA_PED
Text25.Text = registro!BOLSAS
Text26.Text = registro!ENTREGADO
Text15.Text = (registro!FACTURA + 17)
Text20.Text = registro!NOTA_PED
Text4.Text = "0.00"
Text8.Text = "0.00"
NUMERO = registro!NOTA_PED
Else
Text16.Text = "-----------"
Text21.Text = "-----------"
Text22.Text = "-----------"
Text25.Text = "-----------"
Text26.Text = "-----------"
Text15.Text = "-----------"
MsgBox ("No hay NOTA DE VENTA"), vbInformation, "Atención"

End If
If NUMERO = Text20.Text Then


Dim X, Y As Byte
X = 0
GRILLA.Row = X
GRILLA.Col = 0
GRILLA.Text = "CODIGO_PRODUCTO"
GRILLA.Col = 1
GRILLA.Text = "CANTIDAD"


SQL = "select * from Datos_Pedidos where NOTA_PED = " + Text22 + ";"
Set registro = basedato.OpenRecordset(SQL, dbOpenDynaset)
PED = registro!NOTA_PED
If NUMERO = PED Then


SQL = "select * from Datos_Pedidos_Detalle"
Set registro = basedato.OpenRecordset(SQL, dbOpenDynaset)

SQL = "select * from Datos_Pedidos"
Set registro = basedato.OpenRecordset(SQL, dbOpenDynaset)



registro!COD_PRODUCTO = registro!COD_PRODUCTO


Do Until registro.EOF
X = X + 1
If registro!CANTIDAD = PED Then

GRILLA.Row = X
GRILLA.Col = 0
GRILLA.Text = registro!COD_PRODUCTO
GRILLA.Col = 1
GRILLA.Text = registro!CANTIDAD


registro.MoveNext
End If
Loop
registro.Close
End If
End If
End If
End Sub
'alimentos la bodega

@@@@ como puedo incluir la informacion seleccionada por un if????? @@@@@@@@

delarioja
04 de Mayo del 2004
Hola:
Dime, que grid utilizas?
el MsFlexGrid?
Un saludo