Le agregue la funcion Buscar, osea cuando yo pongo el codigo del producto me saltan todos estos datos y esta perfecto me dice que es, cuanto vale, cuanto stock disponible. Les dejo una imagen.

Ahora necesito crear un sistema de ventas, que me de la opcion de vender, que se descuente automaticamente el stock y que se guarde con la fecha y el precio de lo vendido y luego se sume el total dia por dia.
Pero no encontre ni un solo tutorial de como hacer esto con visual basic 6... Alguien conoce alguno?
O pueden ayudarme? gracias !!
EL CODIGO ES:
Código vb:
Ver original
Dim CN As New ADODB.Connection Private Sub Text1_Change() End Sub Private Sub Text2_Change() End Sub Private Sub Text3_Change() End Sub Private Sub Command1_Click() Dim tbl As New ADODB.Recordset tbl.Open "select * from Productos where Codigo=" & Val(txtcodigo.Text), CN, adOpenDynamic, adLockOptimistic If tbl.EOF = True And tbl.EOF = True Then tbl.AddNew tbl("Codigo") = Val(txtcodigo.Text) tbl("Articulo") = txtarticulo.Text tbl("Precio de costo") = txtcosto.Text tbl("Precio de venta") = txtventa.Text tbl("Cantidad") = txtstock.Text tbl.Update Else MsgBox "Este artículo ya existe", vbCritical, "Error" End If Call consulta End Sub Private Sub Command2_Click() Dim tbl As New ADODB.Recordset tbl.Open "select * from Productos where Codigo=" & Val(txtcodigo.Text), CN, adOpenDynamic, adLockOptimistic If tbl.EOF = False And tbl.BOF = False Then txtcodigo.Text = tbl("Codigo") txtarticulo.Text = tbl("Articulo") txtcosto.Text = tbl("Precio de costo") txtventa.Text = tbl("Precio de venta") txtstock.Text = tbl("Cantidad") Else MsgBox "Este artículo no existe", vbCritical, "Error" End If End Sub Private Sub Command3_Click() Dim tbl As New ADODB.Recordset tbl.Open "select * from Productos where Codigo=" & Val(txtcodigo.Text), CN, adOpenDynamic, adLockOptimistic If tbl.EOF = False And tbl.BOF = False Then tbl("Articulo") = txtarticulo.Text tbl("Precio de costo") = txtcosto.Text tbl("Precio de venta") = txtventa.Text tbl.Update Else MsgBox "Este artículo no existe", vbCritical, "Error" End If Call consulta End Sub Private Sub Command4_Click() Dim tbl As New ADODB.Recordset tbl.Open "select * from Productos where Codigo=" & Val(txtcodigo.Text), CN, adOpenDynamic, adLockOptimistic If tbl.EOF = False And tbl.EOF = False Then tbl.Delete tbl.Update Else MsgBox "Este artículo no existe", vbCritical, "Error" End If Call consulta End Sub Private Sub Form_Load() CN.Open "Provider=Microsoft.ACE.OLEDB.12.0; data source=" & App.Path & "\RootsModas.accdb" & ";Persist security info=false" Call consulta End Sub Private Sub consulta() Dim tbl As New ADODB.Recordset tbl.CursorLocation = adUseClient tbl.CursorType = adOpenDynamic tbl.LockType = adLockBatchOptimistic tbl.Open "select * from Productos where Codigo", CN, adOpenDynamic, adLockBatchOptimistic Set dg.DataSource = tbl End Sub