SlideShare a Scribd company logo
CODIGO PARA EL FORMULARIO frm_Entradas
Private SubComboBox1_Change()
DimFilaAs Integer
DimFinal As Integer
If ComboBox1.Value="" Then
Me.txt_Nombre =""
Me.txt_Saldo= ""
End If
For Fila= 2 To 1000
If Hoja2.Cells(Fila,1) = "" AndHoja5.Cells(Fila,1) = "" Then
Final = Fila- 1
ExitFor
EndIf
Next
For Fila= 2 To Final
If ComboBox1= Hoja2.Cells(Fila,1) Then
Me.txt_Nombre =Hoja2.Cells(Fila,2)
ExitFor
EndIf
Next
For Fila= 2 To Final
If ComboBox1= Hoja5.Cells(Fila,1) Then
Me.txt_Saldo=Hoja5.Cells(Fila,3)
ExitFor
EndIf
Next
End Sub
Private SubComboBox1_Enter()
DimFilaAs Integer
DimFinal As Integer
DimLista As String
For Fila= 1 To ComboBox1.ListCount
ComboBox1.RemoveItem0
NextFila
For Fila= 2 To 1000
If Hoja2.Cells(Fila,1) = "" Then
Final = Fila- 1
ExitFor
EndIf
Next
For Fila= 2 To Final
Lista= Hoja2.Cells(Fila,1)
ComboBox1.AddItem(Lista)
Next
End Sub
Private SubCommandButton1_Click()
DimFilaAs Integer
DimFinal As Integer
DimExistenciaAsInteger
DimTotal AsInteger
For Fila= 2 To 1000
If Hoja3.Cells(Fila,1) = "" Then
Final = Fila
ExitFor
EndIf
Next
Hoja3.Cells(Final,1) = Me.ComboBox1
Hoja3.Cells(Final,2) = Me.txt_Nombre
Hoja3.Cells(Final,3) = Me.txt_FechaIng
Hoja3.Cells(Final,4) = Me.txt_Factura
Hoja3.Cells(Final,5) = Me.txt_Proveedor
Hoja3.Cells(Final,6) = Me.txt_Cantidad
For Fila= 2 To 1000
If Hoja5.Cells(Fila,1) = Hoja3.Cells(Final,1) Then
Existencia=Hoja5.Cells(Fila,3)
Total = Me.txt_Cantidad+Existencia
Hoja5.Cells(Fila,3) = Total
ExitFor
EndIf
Next
Me.ComboBox1=""
Me.txt_Nombre =""
Me.txt_FechaIng=""
Me.txt_Factura= ""
Me.txt_Proveedor=""
Me.txt_Cantidad=""
End Sub
Private SubCommandButton2_Click()
UnloadMe
End Sub
CODIGO frm_Menu
Private SubCommandButton1_Click()
frm_RegistrarProducto.Show
End Sub
Private SubCommandButton2_Click()
frm_ModificarProducto.Show
End Sub
Private SubCommandButton3_Click()
frm_Entradas.Show
End Sub
CODIGO frm_ModificarProducto
Private SubComboBox1_Change()
DimFilaAs Integer
DimFinal As Integer
If ComboBox1.Value="" Then
Me.txt_Nombre =""
Me.txt_Descrip= ""
End If
For Fila= 2 To 1000
If Hoja2.Cells(Fila,1) = "" Then
Final = Fila- 1
ExitFor
EndIf
Next
For Fila= 2 To Final
If ComboBox1= Hoja2.Cells(Fila,1) Then
Me.txt_Nombre =Hoja2.Cells(Fila,2)
Me.txt_Descrip=Hoja2.Cells(Fila,3)
ExitFor
EndIf
Next
End Sub
Private SubComboBox1_Enter()
DimFilaAs Integer
DimFinal As Integer
DimLista As String
For Fila= 1 To ComboBox1.ListCount
ComboBox1.RemoveItem0
NextFila
For Fila= 2 To 1000
If Hoja2.Cells(Fila,1) = "" Then
Final = Fila- 1
ExitFor
EndIf
Next
For Fila= 2 To Final
Lista= Hoja2.Cells(Fila,1)
ComboBox1.AddItem(Lista)
Next
End Sub
Private SubCommandButton1_Click()
Dim FilaAsInteger
Dim Final AsInteger
For Fila= 2 To 1000
If Hoja2.Cells(Fila,1) = "" AndHoja3.Cells(Fila,1) = "" AndHoja5.Cells(Fila,1) ="" Then
Final = Fila- 1
ExitFor
EndIf
Next
For Fila= 2 To Final
If Me.ComboBox1= Hoja2.Cells(Fila, 1) Then
Hoja2.Cells(Fila,2) = Me.txt_Nombre
Hoja2.Cells(Fila,3) = Me.txt_Descrip
ExitFor
EndIf
Next
'-------------------------------------------------
For Fila= 2 To Final
If Me.ComboBox1= Hoja3.Cells(Fila,1) Then
Hoja3.Cells(Fila,2) = Me.txt_Nombre
EndIf
Next
For Fila= 2 To Final
If Me.ComboBox1= Hoja5.Cells(Fila,1) Then
Hoja5.Cells(Fila,2) = Me.txt_Nombre
ExitFor
EndIf
Next
'-------------------------------------------------
Me.ComboBox1= ""
Me.txt_Nombre =""
Me.txt_Descrip= ""
End Sub
Private SubCommandButton2_Click()
UnloadMe
End Sub
CODIGO frm_RegistrarProducto
Private SubCommandButton1_Click()
Dim FilaAsInteger
Dim Final AsInteger
Dim RegistroAsInteger
ForFila= 1 To 1000
If Hoja2.Cells(Fila,1) = "" Then
Final = Fila
ExitFor
End If
Next
ForRegistro= 2 To Final
If Hoja2.Cells(Registro,1) = Me.txt_CodProdThen
Me.txt_CodProd.BackColor=&H8080FF
MsgBox ("Registroyaexiste"+Chr(13) + "Ingrese uncódigodiferente")
Me.txt_CodProd.SetFocus
ExitSub
ExitFor
End If
Next
If MsgBox("Soncorrectoslosdatos?"+ Chr(13) + "Deseaproceder?",vbOKCancel) =vbOKThen
Me.txt_CodProd.BackColor=&HFFFFFF
Hoja2.Cells(Final,1) = Me.txt_CodProd
Hoja2.Cells(Final,2) = Me.txt_Nombre
Hoja2.Cells(Final,3) = Me.txt_Descrip
'-----------------------------------------------
Hoja5.Cells(Final,1) = Me.txt_CodProd
Hoja5.Cells(Final,2) = Me.txt_Nombre
Hoja5.Cells(Final,3) = 0
'-----------------------------------------------
Me.txt_CodProd=""
Me.txt_Nombre =""
Me.txt_Descrip= ""
Me.txt_CodProd.SetFocus
Else
ExitSub
End If
End Sub
Private Sub CommandButton2_Click()
UnloadMe
End Sub
MODULO 1
SubMenu_Principal()
frm_Menu.Show
End Sub

More Related Content

Viewers also liked

S4 tarea4 varim
S4 tarea4 varimS4 tarea4 varim
S4 tarea4 varim
angeles vazquez
 
La Mitosi
La MitosiLa Mitosi
Leslie Lessin: Unexpected Layers
Leslie Lessin: Unexpected LayersLeslie Lessin: Unexpected Layers
Leslie Lessin: Unexpected Layers
Leslie Lessin
 
Karlos eduardo rubio albirena cv
Karlos eduardo rubio albirena cvKarlos eduardo rubio albirena cv
Karlos eduardo rubio albirena cv
Karlos Rubio
 
Introducción a la cosmovisión bíblica
Introducción a la cosmovisión bíblicaIntroducción a la cosmovisión bíblica
Introducción a la cosmovisión bíblica
Edgar Devia Góngora
 
Леонид Блайвас. Автоматизация проектной деятельности. Эволюция и факторы успеха
Леонид Блайвас. Автоматизация проектной деятельности. Эволюция и факторы успехаЛеонид Блайвас. Автоматизация проектной деятельности. Эволюция и факторы успеха
Леонид Блайвас. Автоматизация проектной деятельности. Эволюция и факторы успеха
Адванта - онлайн система управления проектами
 
La trinidad misericordiosa
La trinidad misericordiosaLa trinidad misericordiosa
La trinidad misericordiosa
CIPE. El Carmelo
 
Peter 10. Klasse Bevis Alt Inklusiv
Peter 10. Klasse Bevis Alt InklusivPeter 10. Klasse Bevis Alt Inklusiv
Peter 10. Klasse Bevis Alt InklusivPeter Thestrup Waade
 
Alamos copia
Alamos copiaAlamos copia
Alamos copia
Janderson C Fiestas
 
As media revision
As media revisionAs media revision
As media revision
SaffronEvans
 
Coco cola qms
Coco   cola qmsCoco   cola qms
Coco cola qms
Isha Joshi
 

Viewers also liked (12)

S4 tarea4 varim
S4 tarea4 varimS4 tarea4 varim
S4 tarea4 varim
 
La Mitosi
La MitosiLa Mitosi
La Mitosi
 
Leslie Lessin: Unexpected Layers
Leslie Lessin: Unexpected LayersLeslie Lessin: Unexpected Layers
Leslie Lessin: Unexpected Layers
 
Karlos eduardo rubio albirena cv
Karlos eduardo rubio albirena cvKarlos eduardo rubio albirena cv
Karlos eduardo rubio albirena cv
 
Acronym
AcronymAcronym
Acronym
 
Introducción a la cosmovisión bíblica
Introducción a la cosmovisión bíblicaIntroducción a la cosmovisión bíblica
Introducción a la cosmovisión bíblica
 
Леонид Блайвас. Автоматизация проектной деятельности. Эволюция и факторы успеха
Леонид Блайвас. Автоматизация проектной деятельности. Эволюция и факторы успехаЛеонид Блайвас. Автоматизация проектной деятельности. Эволюция и факторы успеха
Леонид Блайвас. Автоматизация проектной деятельности. Эволюция и факторы успеха
 
La trinidad misericordiosa
La trinidad misericordiosaLa trinidad misericordiosa
La trinidad misericordiosa
 
Peter 10. Klasse Bevis Alt Inklusiv
Peter 10. Klasse Bevis Alt InklusivPeter 10. Klasse Bevis Alt Inklusiv
Peter 10. Klasse Bevis Alt Inklusiv
 
Alamos copia
Alamos copiaAlamos copia
Alamos copia
 
As media revision
As media revisionAs media revision
As media revision
 
Coco cola qms
Coco   cola qmsCoco   cola qms
Coco cola qms
 

Recently uploaded

India Diagnostic Labs Market: Dynamics, Key Players, and Industry Projections...
India Diagnostic Labs Market: Dynamics, Key Players, and Industry Projections...India Diagnostic Labs Market: Dynamics, Key Players, and Industry Projections...
India Diagnostic Labs Market: Dynamics, Key Players, and Industry Projections...
Kumar Satyam
 
NKTI Annual Report - Annual Report FY 2022
NKTI Annual Report - Annual Report FY 2022NKTI Annual Report - Annual Report FY 2022
NKTI Annual Report - Annual Report FY 2022
nktiacc3
 
CONSTRUCTION OF TEST IN MANAGEMENT .docx
CONSTRUCTION OF TEST IN MANAGEMENT .docxCONSTRUCTION OF TEST IN MANAGEMENT .docx
CONSTRUCTION OF TEST IN MANAGEMENT .docx
PGIMS Rohtak
 
Navigating Healthcare with Telemedicine
Navigating Healthcare with  TelemedicineNavigating Healthcare with  Telemedicine
Navigating Healthcare with Telemedicine
Iris Thiele Isip-Tan
 
Surgery-Mini-OSCE-All-Past-Years-Questions-Modified.
Surgery-Mini-OSCE-All-Past-Years-Questions-Modified.Surgery-Mini-OSCE-All-Past-Years-Questions-Modified.
Surgery-Mini-OSCE-All-Past-Years-Questions-Modified.
preciousstephanie75
 
Health Education on prevention of hypertension
Health Education on prevention of hypertensionHealth Education on prevention of hypertension
Health Education on prevention of hypertension
Radhika kulvi
 
CHAPTER 1 SEMESTER V - ROLE OF PEADIATRIC NURSE.pdf
CHAPTER 1 SEMESTER V - ROLE OF PEADIATRIC NURSE.pdfCHAPTER 1 SEMESTER V - ROLE OF PEADIATRIC NURSE.pdf
CHAPTER 1 SEMESTER V - ROLE OF PEADIATRIC NURSE.pdf
Sachin Sharma
 
ABDOMINAL COMPARTMENT SYSNDROME
ABDOMINAL COMPARTMENT SYSNDROMEABDOMINAL COMPARTMENT SYSNDROME
ABDOMINAL COMPARTMENT SYSNDROME
Rommel Luis III Israel
 
GURGAON Call Girls ❤8901183002❤ #ℂALL# #gIRLS# In GURGAON ₹,2500 Cash Payment...
GURGAON Call Girls ❤8901183002❤ #ℂALL# #gIRLS# In GURGAON ₹,2500 Cash Payment...GURGAON Call Girls ❤8901183002❤ #ℂALL# #gIRLS# In GURGAON ₹,2500 Cash Payment...
GURGAON Call Girls ❤8901183002❤ #ℂALL# #gIRLS# In GURGAON ₹,2500 Cash Payment...
ranishasharma67
 
The Docs PPG - 30.05.2024.pptx..........
The Docs PPG - 30.05.2024.pptx..........The Docs PPG - 30.05.2024.pptx..........
The Docs PPG - 30.05.2024.pptx..........
TheDocs
 
Empowering ACOs: Leveraging Quality Management Tools for MIPS and Beyond
Empowering ACOs: Leveraging Quality Management Tools for MIPS and BeyondEmpowering ACOs: Leveraging Quality Management Tools for MIPS and Beyond
Empowering ACOs: Leveraging Quality Management Tools for MIPS and Beyond
Health Catalyst
 
Haridwar ❤CALL Girls 🔝 89011★83002 🔝 ❤ℂall Girls IN Haridwar ESCORT SERVICE❤
Haridwar ❤CALL Girls 🔝 89011★83002 🔝 ❤ℂall Girls IN Haridwar ESCORT SERVICE❤Haridwar ❤CALL Girls 🔝 89011★83002 🔝 ❤ℂall Girls IN Haridwar ESCORT SERVICE❤
Haridwar ❤CALL Girls 🔝 89011★83002 🔝 ❤ℂall Girls IN Haridwar ESCORT SERVICE❤
ranishasharma67
 
POLYCYSTIC OVARIAN SYNDROME (PCOS)......
POLYCYSTIC OVARIAN SYNDROME (PCOS)......POLYCYSTIC OVARIAN SYNDROME (PCOS)......
POLYCYSTIC OVARIAN SYNDROME (PCOS)......
Ameena Kadar
 
HEAT WAVE presented by priya bhojwani..pptx
HEAT WAVE presented by priya bhojwani..pptxHEAT WAVE presented by priya bhojwani..pptx
HEAT WAVE presented by priya bhojwani..pptx
priyabhojwani1200
 
The Impact of Meeting: How It Can Change Your Life
The Impact of Meeting: How It Can Change Your LifeThe Impact of Meeting: How It Can Change Your Life
The Impact of Meeting: How It Can Change Your Life
ranishasharma67
 
LGBTQ+ Adults: Unique Opportunities and Inclusive Approaches to Care
LGBTQ+ Adults: Unique Opportunities and Inclusive Approaches to CareLGBTQ+ Adults: Unique Opportunities and Inclusive Approaches to Care
LGBTQ+ Adults: Unique Opportunities and Inclusive Approaches to Care
VITASAuthor
 
Jaipur ❤cALL gIRLS 89O1183002 ❤ℂall Girls IN JaiPuR ESCORT SERVICE
Jaipur ❤cALL gIRLS 89O1183002 ❤ℂall Girls IN JaiPuR ESCORT SERVICEJaipur ❤cALL gIRLS 89O1183002 ❤ℂall Girls IN JaiPuR ESCORT SERVICE
Jaipur ❤cALL gIRLS 89O1183002 ❤ℂall Girls IN JaiPuR ESCORT SERVICE
ranishasharma67
 
ventilator, child on ventilator, newborn
ventilator, child on ventilator, newbornventilator, child on ventilator, newborn
ventilator, child on ventilator, newborn
Pooja Rani
 
Nursing Care of Client With Acute And Chronic Renal Failure.ppt
Nursing Care of Client With Acute And Chronic Renal Failure.pptNursing Care of Client With Acute And Chronic Renal Failure.ppt
Nursing Care of Client With Acute And Chronic Renal Failure.ppt
Rommel Luis III Israel
 
How many patients does case series should have In comparison to case reports.pdf
How many patients does case series should have In comparison to case reports.pdfHow many patients does case series should have In comparison to case reports.pdf
How many patients does case series should have In comparison to case reports.pdf
pubrica101
 

Recently uploaded (20)

India Diagnostic Labs Market: Dynamics, Key Players, and Industry Projections...
India Diagnostic Labs Market: Dynamics, Key Players, and Industry Projections...India Diagnostic Labs Market: Dynamics, Key Players, and Industry Projections...
India Diagnostic Labs Market: Dynamics, Key Players, and Industry Projections...
 
NKTI Annual Report - Annual Report FY 2022
NKTI Annual Report - Annual Report FY 2022NKTI Annual Report - Annual Report FY 2022
NKTI Annual Report - Annual Report FY 2022
 
CONSTRUCTION OF TEST IN MANAGEMENT .docx
CONSTRUCTION OF TEST IN MANAGEMENT .docxCONSTRUCTION OF TEST IN MANAGEMENT .docx
CONSTRUCTION OF TEST IN MANAGEMENT .docx
 
Navigating Healthcare with Telemedicine
Navigating Healthcare with  TelemedicineNavigating Healthcare with  Telemedicine
Navigating Healthcare with Telemedicine
 
Surgery-Mini-OSCE-All-Past-Years-Questions-Modified.
Surgery-Mini-OSCE-All-Past-Years-Questions-Modified.Surgery-Mini-OSCE-All-Past-Years-Questions-Modified.
Surgery-Mini-OSCE-All-Past-Years-Questions-Modified.
 
Health Education on prevention of hypertension
Health Education on prevention of hypertensionHealth Education on prevention of hypertension
Health Education on prevention of hypertension
 
CHAPTER 1 SEMESTER V - ROLE OF PEADIATRIC NURSE.pdf
CHAPTER 1 SEMESTER V - ROLE OF PEADIATRIC NURSE.pdfCHAPTER 1 SEMESTER V - ROLE OF PEADIATRIC NURSE.pdf
CHAPTER 1 SEMESTER V - ROLE OF PEADIATRIC NURSE.pdf
 
ABDOMINAL COMPARTMENT SYSNDROME
ABDOMINAL COMPARTMENT SYSNDROMEABDOMINAL COMPARTMENT SYSNDROME
ABDOMINAL COMPARTMENT SYSNDROME
 
GURGAON Call Girls ❤8901183002❤ #ℂALL# #gIRLS# In GURGAON ₹,2500 Cash Payment...
GURGAON Call Girls ❤8901183002❤ #ℂALL# #gIRLS# In GURGAON ₹,2500 Cash Payment...GURGAON Call Girls ❤8901183002❤ #ℂALL# #gIRLS# In GURGAON ₹,2500 Cash Payment...
GURGAON Call Girls ❤8901183002❤ #ℂALL# #gIRLS# In GURGAON ₹,2500 Cash Payment...
 
The Docs PPG - 30.05.2024.pptx..........
The Docs PPG - 30.05.2024.pptx..........The Docs PPG - 30.05.2024.pptx..........
The Docs PPG - 30.05.2024.pptx..........
 
Empowering ACOs: Leveraging Quality Management Tools for MIPS and Beyond
Empowering ACOs: Leveraging Quality Management Tools for MIPS and BeyondEmpowering ACOs: Leveraging Quality Management Tools for MIPS and Beyond
Empowering ACOs: Leveraging Quality Management Tools for MIPS and Beyond
 
Haridwar ❤CALL Girls 🔝 89011★83002 🔝 ❤ℂall Girls IN Haridwar ESCORT SERVICE❤
Haridwar ❤CALL Girls 🔝 89011★83002 🔝 ❤ℂall Girls IN Haridwar ESCORT SERVICE❤Haridwar ❤CALL Girls 🔝 89011★83002 🔝 ❤ℂall Girls IN Haridwar ESCORT SERVICE❤
Haridwar ❤CALL Girls 🔝 89011★83002 🔝 ❤ℂall Girls IN Haridwar ESCORT SERVICE❤
 
POLYCYSTIC OVARIAN SYNDROME (PCOS)......
POLYCYSTIC OVARIAN SYNDROME (PCOS)......POLYCYSTIC OVARIAN SYNDROME (PCOS)......
POLYCYSTIC OVARIAN SYNDROME (PCOS)......
 
HEAT WAVE presented by priya bhojwani..pptx
HEAT WAVE presented by priya bhojwani..pptxHEAT WAVE presented by priya bhojwani..pptx
HEAT WAVE presented by priya bhojwani..pptx
 
The Impact of Meeting: How It Can Change Your Life
The Impact of Meeting: How It Can Change Your LifeThe Impact of Meeting: How It Can Change Your Life
The Impact of Meeting: How It Can Change Your Life
 
LGBTQ+ Adults: Unique Opportunities and Inclusive Approaches to Care
LGBTQ+ Adults: Unique Opportunities and Inclusive Approaches to CareLGBTQ+ Adults: Unique Opportunities and Inclusive Approaches to Care
LGBTQ+ Adults: Unique Opportunities and Inclusive Approaches to Care
 
Jaipur ❤cALL gIRLS 89O1183002 ❤ℂall Girls IN JaiPuR ESCORT SERVICE
Jaipur ❤cALL gIRLS 89O1183002 ❤ℂall Girls IN JaiPuR ESCORT SERVICEJaipur ❤cALL gIRLS 89O1183002 ❤ℂall Girls IN JaiPuR ESCORT SERVICE
Jaipur ❤cALL gIRLS 89O1183002 ❤ℂall Girls IN JaiPuR ESCORT SERVICE
 
ventilator, child on ventilator, newborn
ventilator, child on ventilator, newbornventilator, child on ventilator, newborn
ventilator, child on ventilator, newborn
 
Nursing Care of Client With Acute And Chronic Renal Failure.ppt
Nursing Care of Client With Acute And Chronic Renal Failure.pptNursing Care of Client With Acute And Chronic Renal Failure.ppt
Nursing Care of Client With Acute And Chronic Renal Failure.ppt
 
How many patients does case series should have In comparison to case reports.pdf
How many patients does case series should have In comparison to case reports.pdfHow many patients does case series should have In comparison to case reports.pdf
How many patients does case series should have In comparison to case reports.pdf
 

Codigo para el formulario frm

  • 1. CODIGO PARA EL FORMULARIO frm_Entradas Private SubComboBox1_Change() DimFilaAs Integer DimFinal As Integer If ComboBox1.Value="" Then Me.txt_Nombre ="" Me.txt_Saldo= "" End If For Fila= 2 To 1000 If Hoja2.Cells(Fila,1) = "" AndHoja5.Cells(Fila,1) = "" Then Final = Fila- 1 ExitFor EndIf Next For Fila= 2 To Final If ComboBox1= Hoja2.Cells(Fila,1) Then Me.txt_Nombre =Hoja2.Cells(Fila,2) ExitFor EndIf Next
  • 2. For Fila= 2 To Final If ComboBox1= Hoja5.Cells(Fila,1) Then Me.txt_Saldo=Hoja5.Cells(Fila,3) ExitFor EndIf Next End Sub Private SubComboBox1_Enter() DimFilaAs Integer DimFinal As Integer DimLista As String For Fila= 1 To ComboBox1.ListCount ComboBox1.RemoveItem0 NextFila For Fila= 2 To 1000 If Hoja2.Cells(Fila,1) = "" Then Final = Fila- 1 ExitFor EndIf Next
  • 3. For Fila= 2 To Final Lista= Hoja2.Cells(Fila,1) ComboBox1.AddItem(Lista) Next End Sub Private SubCommandButton1_Click() DimFilaAs Integer DimFinal As Integer DimExistenciaAsInteger DimTotal AsInteger For Fila= 2 To 1000 If Hoja3.Cells(Fila,1) = "" Then Final = Fila ExitFor EndIf Next Hoja3.Cells(Final,1) = Me.ComboBox1 Hoja3.Cells(Final,2) = Me.txt_Nombre Hoja3.Cells(Final,3) = Me.txt_FechaIng Hoja3.Cells(Final,4) = Me.txt_Factura
  • 4. Hoja3.Cells(Final,5) = Me.txt_Proveedor Hoja3.Cells(Final,6) = Me.txt_Cantidad For Fila= 2 To 1000 If Hoja5.Cells(Fila,1) = Hoja3.Cells(Final,1) Then Existencia=Hoja5.Cells(Fila,3) Total = Me.txt_Cantidad+Existencia Hoja5.Cells(Fila,3) = Total ExitFor EndIf Next Me.ComboBox1="" Me.txt_Nombre ="" Me.txt_FechaIng="" Me.txt_Factura= "" Me.txt_Proveedor="" Me.txt_Cantidad="" End Sub Private SubCommandButton2_Click() UnloadMe End Sub
  • 5. CODIGO frm_Menu Private SubCommandButton1_Click() frm_RegistrarProducto.Show End Sub Private SubCommandButton2_Click() frm_ModificarProducto.Show End Sub Private SubCommandButton3_Click() frm_Entradas.Show End Sub CODIGO frm_ModificarProducto Private SubComboBox1_Change() DimFilaAs Integer DimFinal As Integer If ComboBox1.Value="" Then Me.txt_Nombre ="" Me.txt_Descrip= "" End If For Fila= 2 To 1000 If Hoja2.Cells(Fila,1) = "" Then Final = Fila- 1 ExitFor EndIf Next
  • 6. For Fila= 2 To Final If ComboBox1= Hoja2.Cells(Fila,1) Then Me.txt_Nombre =Hoja2.Cells(Fila,2) Me.txt_Descrip=Hoja2.Cells(Fila,3) ExitFor EndIf Next End Sub Private SubComboBox1_Enter() DimFilaAs Integer DimFinal As Integer DimLista As String For Fila= 1 To ComboBox1.ListCount ComboBox1.RemoveItem0 NextFila For Fila= 2 To 1000 If Hoja2.Cells(Fila,1) = "" Then Final = Fila- 1 ExitFor
  • 7. EndIf Next For Fila= 2 To Final Lista= Hoja2.Cells(Fila,1) ComboBox1.AddItem(Lista) Next End Sub Private SubCommandButton1_Click() Dim FilaAsInteger Dim Final AsInteger For Fila= 2 To 1000 If Hoja2.Cells(Fila,1) = "" AndHoja3.Cells(Fila,1) = "" AndHoja5.Cells(Fila,1) ="" Then Final = Fila- 1 ExitFor EndIf Next For Fila= 2 To Final If Me.ComboBox1= Hoja2.Cells(Fila, 1) Then Hoja2.Cells(Fila,2) = Me.txt_Nombre Hoja2.Cells(Fila,3) = Me.txt_Descrip
  • 8. ExitFor EndIf Next '------------------------------------------------- For Fila= 2 To Final If Me.ComboBox1= Hoja3.Cells(Fila,1) Then Hoja3.Cells(Fila,2) = Me.txt_Nombre EndIf Next For Fila= 2 To Final If Me.ComboBox1= Hoja5.Cells(Fila,1) Then Hoja5.Cells(Fila,2) = Me.txt_Nombre ExitFor EndIf Next '------------------------------------------------- Me.ComboBox1= "" Me.txt_Nombre ="" Me.txt_Descrip= ""
  • 9. End Sub Private SubCommandButton2_Click() UnloadMe End Sub CODIGO frm_RegistrarProducto Private SubCommandButton1_Click() Dim FilaAsInteger Dim Final AsInteger Dim RegistroAsInteger ForFila= 1 To 1000 If Hoja2.Cells(Fila,1) = "" Then Final = Fila ExitFor End If Next ForRegistro= 2 To Final If Hoja2.Cells(Registro,1) = Me.txt_CodProdThen Me.txt_CodProd.BackColor=&H8080FF MsgBox ("Registroyaexiste"+Chr(13) + "Ingrese uncódigodiferente") Me.txt_CodProd.SetFocus
  • 10. ExitSub ExitFor End If Next If MsgBox("Soncorrectoslosdatos?"+ Chr(13) + "Deseaproceder?",vbOKCancel) =vbOKThen Me.txt_CodProd.BackColor=&HFFFFFF Hoja2.Cells(Final,1) = Me.txt_CodProd Hoja2.Cells(Final,2) = Me.txt_Nombre Hoja2.Cells(Final,3) = Me.txt_Descrip '----------------------------------------------- Hoja5.Cells(Final,1) = Me.txt_CodProd Hoja5.Cells(Final,2) = Me.txt_Nombre Hoja5.Cells(Final,3) = 0 '----------------------------------------------- Me.txt_CodProd="" Me.txt_Nombre ="" Me.txt_Descrip= "" Me.txt_CodProd.SetFocus Else ExitSub End If End Sub Private Sub CommandButton2_Click() UnloadMe