Diseño: Commandbutton4 Commandbutton6

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 10

DISEO

CREAR 6 FORMULARIOS, TAL COMO SE MUESTRA EN LA FIGURA, LUEGO COLOCAR SUS RESPECTIVOS BOTONES COMOS E MUESTRAN A CONTINUACION

FORMULARIO 1

CommandButton4 CommandButton5 CommandButton1 CommandButton3

CommandButton6 CommandButton7

FORMULARIO 2

TextBox1 TextBox2

TextBox3 CommandButton1 CommandButton2

FORMULARIO 3

ComboBox1 TextBox1

TextBox2 CommandButton1

CommandButton2

FORMULARIO 4

ComboBox1 TextBox1 TextBox2 TextBox3 TextBox4 DTPicker1

TextBox5 CommandButton2

CommandButton1

FORMULARIO 5

ComboBox1 TextBox1 TextBox2 TextBox3 TextBox4 TextBox5 DTPicker1 TextBox6 CommandButton1 CommandButton2

FORMULARIO 6

CODIFICACION FORMULARIO 1 *************************************************** Private Sub CommandButton1_Click() UserForm6.Show End Sub *************************************************** Private Sub CommandButton3_Click() Unload Me End Sub *************************************************** Private Sub CommandButton4_Click() UserForm2.Show End Sub *************************************************** Private Sub CommandButton5_Click() UserForm3.Show End Sub *************************************************** Private Sub CommandButton6_Click() UserForm4.Show End Sub *************************************************** Private Sub CommandButton7_Click() UserForm5.Show End Sub *************************************************** FORMULARIO 2 *************************************************** Private Sub CommandButton1_Click() If TextBox1.Text = "" Then MsgBox ("INGRESE UN CODIGO") TextBox1.SetFocus TextBox1.BackColor = &HC000& Exit Sub End If TextBox1.BackColor = &H80000005 If TextBox2.Text = "" Then MsgBox ("INGRESE UN NOMBRE") TextBox2.SetFocus TextBox2.BackColor = &HC000& Exit Sub End If TextBox2.BackColor = &H80000005 If TextBox3.Text = "" Then MsgBox ("INGRESE UNA DESCRIPCION") TextBox3.SetFocus

TextBox3.BackColor = &HC000& Exit Sub End If TextBox3.BackColor = &H80000005 Sheets("PRODUCTO").Select Range("A2").Select While ActiveCell.Value <> "" If ActiveCell.Value = TextBox1.Text Then MsgBox ("EL CODIGO YA EXISTE INGRESE UNO NUEVO") TextBox1.SetFocus TextBox1.BackColor = &HC000& Exit Sub End If ActiveCell.Offset(0, 1).Select If ActiveCell.Value = TextBox2.Text Then MsgBox ("EL NOMBRE YA EXISTE INGRESE UNO NUEVO") TextBox2.SetFocus TextBox2.BackColor = &HC000& Exit Sub End If ActiveCell.Offset(0, -1).Select ActiveCell.Offset(1, 0).Select Wend ActiveCell.Value = TextBox1.Text ActiveCell.Offset(0, 1).Select ActiveCell.Value = TextBox2.Text ActiveCell.Offset(0, 1).Select ActiveCell.Value = TextBox3.Text End Sub *************************************************** Private Sub CommandButton2_Click() Unload Me End Sub ***************************************************

FORMULARIO 3 *************************************************** Private Sub ComboBox1_Click() Range("A2").Select While ActiveCell.Value <> ComboBox1.Text ActiveCell.Offset(1, 0).Select Wend ActiveCell.Offset(0, 1).Select TextBox1.Text = ActiveCell.Value ActiveCell.Offset(0, 1).Select TextBox2.Text = ActiveCell.Value ActiveCell.Offset(0, -1).Select End Sub *************************************************** Private Sub CommandButton1_Click() ActiveCell.Value = TextBox1.Text ActiveCell.Offset(0, 1).Select ActiveCell.Value = TextBox2.Text End Sub *************************************************** Private Sub CommandButton2_Click() Unload Me End Sub *************************************************** Private Sub UserForm_Activate() Sheets("PRODUCTO").Select Range("A2").Select While ActiveCell.Value <> "" ComboBox1.AddItem (ActiveCell.Value) ActiveCell.Offset(1, 0).Select Wend End Sub ***************************************************

FORMULARIO 4 *************************************************** Private Sub ComboBox1_Click() Sheets("SALDO").Select Range("A2").Select While ActiveCell.Value <> ComboBox1.Text ActiveCell.Offset(1, 0).Select Wend ActiveCell.Offset(0, 1).Select TextBox1.Text = ActiveCell.Value ActiveCell.Offset(0, 1).Select TextBox2.Text = ActiveCell.Value End Sub *************************************************** Private Sub CommandButton1_Click() If ComboBox1.Text = "" Then MsgBox ("SELECCIONE UN CODIGO DE PRODUCTO") ComboBox1.SetFocus Exit Sub End If If TextBox3.Text = "" Then MsgBox ("UNGRESE UNA CANTIDAD") TextBox3.BackColor = &HC000& TextBox3.SetFocus Exit Sub End If TextBox3.BackColor = &H80000005 If TextBox4.Text = "" Then MsgBox ("UNGRESE UN PROVEEDOR") TextBox4.BackColor = &HC000& TextBox4.SetFocus Exit Sub End If TextBox4.BackColor = &H80000005 If TextBox5.Text = "" Then MsgBox ("UNGRESE LA GUIA") TextBox5.BackColor = &HC000& TextBox5.SetFocus Exit Sub End If TextBox5.BackColor = &H80000005 ActiveCell.Value = ActiveCell.Value + Val(TextBox3.Text) Sheets("ENTRADAS").Select Range("A2").Select While ActiveCell.Value <> "" ActiveCell.Offset(1, 0).Select Wend

ActiveCell.Value = ComboBox1.Text ActiveCell.Offset(0, 1).Select ActiveCell.Value = TextBox1.Text ActiveCell.Offset(0, 1).Select ActiveCell.Value = TextBox3.Text ActiveCell.Offset(0, 1).Select ActiveCell.Value = TextBox4.Text ActiveCell.Offset(0, 1).Select ActiveCell.Value = DTPicker1 ActiveCell.Offset(0, 1).Select ActiveCell.Value = TextBox5 End Sub *************************************************** Private Sub CommandButton2_Click() Unload Me End Sub *************************************************** Private Sub UserForm_Activate() Sheets("PRODUCTO").Select Range("A2").Select While ActiveCell.Value <> "" ComboBox1.AddItem (ActiveCell.Value) ActiveCell.Offset(1, 0).Select Wend End Sub *************************************************** FORMULARIO 5 *************************************************** Private Sub ComboBox1_Click() Sheets("SALDO").Select Range("A2").Select While ActiveCell.Value <> ComboBox1.Text ActiveCell.Offset(1, 0).Select Wend ActiveCell.Offset(0, 1).Select TextBox1.Text = ActiveCell.Value ActiveCell.Offset(0, 1).Select TextBox2.Text = ActiveCell.Value End Sub *************************************************** Private Sub CommandButton1_Click() If ComboBox1.Text = "" Then MsgBox ("SELECCIONE UN CODIGO DEP RODUCTO") ComboBox1.SetFocus Exit Sub End If If TextBox3.Text = "" Then

MsgBox ("INTRODUCCA UNA CANTIDAD DE SALIDA") TextBox3.SetFocus TextBox3.BackColor = &HC000& Exit Sub End If TextBox3.BackColor = &H80000005 If TextBox5.Text = "" Then MsgBox ("INGRESE EL CLIENTE") TextBox5.SetFocus TextBox5.BackColor = &HC000& Exit Sub End If TextBox5.BackColor = &H80000005 If TextBox6.Text = "" Then MsgBox ("INTRODUCCA LA GUIA DE REMISION") TextBox6.SetFocus TextBox6.BackColor = &HC000& Exit Sub End If TextBox6.BackColor = &H80000005 ActiveCell.Value = Val(TextBox4) Sheets("SALIDAS").Select Range("A2").Select While ActiveCell.Value <> "" ActiveCell.Offset(1, 0).Select Wend ActiveCell.Value = ComboBox1.Text ActiveCell.Offset(0, 1).Select ActiveCell.Value = TextBox1.Text ActiveCell.Offset(0, 1).Select ActiveCell.Value = TextBox3.Text ActiveCell.Offset(0, 1).Select ActiveCell.Value = TextBox5.Text ActiveCell.Offset(0, 1).Select ActiveCell.Value = DTPicker1 ActiveCell.Offset(0, 1).Select ActiveCell.Value = TextBox6.Text ComboBox1_Click TextBox3 = "0" End Sub *************************************************** Private Sub CommandButton2_Click() Unload Me End Sub *************************************************** Private Sub TextBox3_Change() TextBox4 = Val(TextBox2.Text) - Val(TextBox3.Text) End Sub

*************************************************** Private Sub UserForm_Activate() Sheets("PRODUCTO").Select Range("A2").Select While ActiveCell.Value <> "" ComboBox1.AddItem (ActiveCell.Value) ActiveCell.Offset(1, 0).Select Wend End Sub *************************************************** FORMULARIO 6 PARA DESARROLAR

You might also like