Estoy haciendo una aplicación para cargar datos a un inventario de productos carnicos el problema es que cada vez que quiero cargar una caja con codigo de barras ésta la carga perfectamente al inventario pero debo elegir, nuevamente, el código del corte cada vez que quiero cargar datos al inventario y ésto hace mas lento el proceso.
La idea seria elegir el código del producto cargar la cantidad de entrada las veces que sea necesaria sin tener que elegir nuevamente el producto a cargar cada vez que ingreso cantidades a mi inventario.
[URL="http://www.yasypora.com/img/IMG1.jpg"]http://www.yasypora.com/img/IMG1.jpg[/URL]
Dejo un link de lo que intento hacer con el código que manejo. ayuda porfa!
este es el código del print screen
Private Sub ComboBox1_Click()
Dim i As Double
Dim j As Double
Dim final As Double
Dim FINAL2 As Double
For i = 2 To 1000
If Hoja5.Cells(i, 1) = "" Then
final = i - 1
Exit For
End If
Next
For i = 2 To 1000
If Hoja6.Cells(i, 1) = "" Then
FINAL2 = i - 1
Exit For
End If
Next
For i = 2 To final
If ComboBox1 = Hoja5.Cells(i, 1) Then
TextBox1 = Hoja5.Cells(i, 2)
Exit For
End If
Next
For j = 1 To FINAL2
If ComboBox1 = Hoja6.Cells(j, 1) Then
TextBox8 = Hoja6.Cells(j, 3)
Exit For
End If
Next
End Sub
Private Sub ComboBox1_Enter()
Dim i As Double
Dim j As Double
Dim H As Double
Dim final As Double
Dim tareas As String
ComboBox1.BackColor = &H80000005
For i = 1 To ComboBox1.ListCount
ComboBox1.RemoveItem 0
Next i
For j = 2 To 1000
If Hoja5.Cells(j, 1) = "" Then
final = j - 1
Exit For
End If
Next
For H = 2 To final
tareas = Hoja5.Cells(H, 1)
ComboBox1.AddItem (tareas)
Next
'End If
End Sub
Private Sub CommandButton1_Click()
Dim validar As Boolean
Dim validarfecha As Boolean
Dim i As Double
Dim j As Double
Dim final As Double
Dim actual As Double
If TextBox1 = "" Then
Exit Sub
End If
If TextBox2 = "" Then
UserForm11.Show
Exit Sub
End If
validar = IsNumeric(TextBox2.Value)
If validar = False Then
UserForm22.Show
TextBox2.BackColor = &HFF00&
Exit Sub
End If
If TextBox2 <> "" And TextBox1 <> "" Then
TextBox2.BackColor = -2147483643
TextBox6.BackColor = -2147483643
End If
For i = 1 To 1000
If Hoja2.Cells(i, 1) = "" Then
final = i
Exit For
End If
Next
Hoja2.Cells(final, 1) = UserForm2.ComboBox1
Hoja2.Cells(final, 2) = UserForm2.TextBox1
Hoja2.Cells(final, 3) = UserForm2.TextBox2
Hoja2.Cells(final, 4) = UserForm2.TextBox4
Hoja2.Cells(final, 5) = UserForm2.TextBox6
Hoja2.Cells(final, 6) = UserForm2.TextBox7
For j = 1 To 1000
If Hoja6.Cells(j, 1) = Hoja2.Cells(final, 1) Then
actual = Hoja6.Cells(j, 3)
final = UserForm2.TextBox2 + actual
Hoja6.Cells(j, 3) = final
Exit For
End If
Next
UserForm2.ComboBox1 = ""
UserForm2.TextBox1 = ""
UserForm2.TextBox2 = ""
UserForm2.TextBox4 = ""
UserForm2.TextBox6 = ""
UserForm2.TextBox7 = ""
UserForm2.TextBox8 = ""
End Sub
Private Sub CommandButton2_Click()
UserForm2.Hide
End Sub
Private Sub TextBox2_Change()
Dim validar As Boolean
Dim validarfecha As Boolean
Dim i As Double
Dim j As Double
Dim final As Double
Dim actual As Double
If TextBox1 = "" Then
Exit Sub
End If
If TextBox2 = "" Then
UserForm11.Show
Exit Sub
End If
validar = IsNumeric(TextBox2.Value)
If validar = False Then
UserForm22.Show
TextBox2.BackColor = &HFF00&
Exit Sub
End If
If TextBox2 <> "" And TextBox1 <> "" Then
TextBox2.BackColor = -2147483643
TextBox6.BackColor = -2147483643
End If
For i = 1 To 1000
If Hoja2.Cells(i, 1) = "" Then
final = i
Exit For
End If
Next
Hoja2.Cells(final, 1) = UserForm2.ComboBox1
Hoja2.Cells(final, 2) = UserForm2.TextBox1
Hoja2.Cells(final, 3) = UserForm2.TextBox2
Hoja2.Cells(final, 4) = UserForm2.TextBox4
Hoja2.Cells(final, 5) = UserForm2.TextBox6
Hoja2.Cells(final, 6) = UserForm2.TextBox7
For j = 1 To 1000
If Hoja6.Cells(j, 1) = Hoja2.Cells(final, 1) Then
actual = Hoja6.Cells(j, 3)
final = UserForm2.TextBox2 + actual
Hoja6.Cells(j, 3) = final
Exit For
End If
Next
UserForm2.ComboBox1 = ""
UserForm2.TextBox1 = ""
UserForm2.TextBox2 = ""
UserForm2.TextBox4 = ""
UserForm2.TextBox6 = ""
UserForm2.TextBox7 = ""
UserForm2.TextBox8 = ""
End Sub