VERSION 5.00 Begin VB.Form Form6 BackColor = &H00C0CEC0& BorderStyle = 4 'Fixed ToolWindow Caption = "Modificación Producto" ClientHeight = 5145 ClientLeft = 60 ClientTop = 525 ClientWidth = 10320 LinkTopic = "Form6" MaxButton = 0 'False MDIChild = -1 'True MinButton = 0 'False ScaleHeight = 5145 ScaleWidth = 10320 ShowInTaskbar = 0 'False Begin VB.CommandButton Command2 Caption = "Cancelar" Height = 375 Left = 8400 TabIndex = 11 Top = 480 Width = 1095 End Begin VB.CommandButton Command1 BackColor = &H0080C0FF& Caption = "Confirmar modificaciones" Height = 615 Left = 1080 TabIndex = 1 Top = 360 Width = 1215 End Begin VB.TextBox Text1 Alignment = 2 'Center BackColor = &H0098FEFF& Height = 285 Index = 0 Left = 480 TabIndex = 0 Text = "Text1" Top = 120 Visible = 0 'False Width = 1695 End Begin VB.Label Label8 BackColor = &H00C0CEC0& Caption = "Nota: Campos modificables en color mas intenso" Height = 255 Left = 360 TabIndex = 10 Top = 4080 Width = 3495 End Begin VB.Label Label7 Alignment = 2 'Center Appearance = 0 'Flat BackColor = &H00C0E0FF& BorderStyle = 1 'Fixed Single Caption = "Tiempo" ForeColor = &H80000008& Height = 255 Left = 9240 TabIndex = 9 Top = 1440 Width = 840 End Begin VB.Label Label6 Alignment = 2 'Center Appearance = 0 'Flat BackColor = &H00C0E0FF& BorderStyle = 1 'Fixed Single Caption = "Proceso" ForeColor = &H80000008& Height = 255 Left = 7320 TabIndex = 8 Top = 1440 Width = 1920 End Begin VB.Label Label5 Alignment = 2 'Center Appearance = 0 'Flat BackColor = &H00C0E0FF& BorderStyle = 1 'Fixed Single Caption = "Longitud" ForeColor = &H80000008& Height = 255 Left = 6480 TabIndex = 7 Top = 1440 Width = 840 End Begin VB.Label Label4 Alignment = 2 'Center Appearance = 0 'Flat BackColor = &H00C0E0FF& BorderStyle = 1 'Fixed Single Caption = "Espesor" ForeColor = &H80000008& Height = 255 Left = 5640 TabIndex = 6 Top = 1440 Width = 840 End Begin VB.Label Label3 Alignment = 2 'Center Appearance = 0 'Flat BackColor = &H00C0E0FF& BorderStyle = 1 'Fixed Single Caption = "Medida2" ForeColor = &H80000008& Height = 255 Left = 4800 TabIndex = 5 Top = 1440 Width = 840 End Begin VB.Label Label2 Alignment = 2 'Center Appearance = 0 'Flat BackColor = &H00C0E0FF& BorderStyle = 1 'Fixed Single Caption = "Medida1" ForeColor = &H80000008& Height = 255 Left = 3960 TabIndex = 4 Top = 1440 Width = 840 End Begin VB.Label Label1 Alignment = 2 'Center Appearance = 0 'Flat BackColor = &H00C0E0FF& BorderStyle = 1 'Fixed Single Caption = "Unidades" ForeColor = &H80000008& Height = 255 Left = 3120 TabIndex = 3 Top = 1440 Width = 840 End Begin VB.Label Pieza Alignment = 2 'Center Appearance = 0 'Flat BackColor = &H00C0E0FF& BorderStyle = 1 'Fixed Single Caption = "Pieza" ForeColor = &H80000008& Height = 255 Left = 120 TabIndex = 2 Top = 1445 Width = 3000 End End Attribute VB_Name = "Form6" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private conn As New ADODB.Connection Private rsipieza As ADODB.Recordset Private rsiproceso As ADODB.Recordset Private Sub Command1_Click() 'PASO DE DATOS A LA BASE DE DATOS ' Por si ya estaba abierta la conexion ... Set conn = Nothing Set rsipieza = Nothing Set rsiproceso = Nothing ' Crear los objetos Set conn = New ADODB.Connection Set rsipieza = New ADODB.Recordset Set rsiproceso = New ADODB.Recordset ' Abrir la base con el proveedor correspondiente conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\DBPROSS.mdb" 'Actualiza cambios en la tabla pieza Dim n As Integer Dim otratabla() As String Dim busqueda As Double Dim ultimo As Integer Dim vupdate As String otratabla = tabla(2) ultimo = Text1.Count 'comprueba si los datos son incorrectos Dim Cancel As Boolean Dim h As Integer h = 0 For n = 0 To ultimo - 10 If Not IsNumeric(Text1(n + 3).Text) Then Cancel = True ElseIf CDbl(Text1(n + 3).Text) < 0 Then Cancel = True End If If Cancel = True Then MsgBox "Por favor, escriba un dato numérico correcto", vbExclamation h = h + 1 Cancel = False End If If Not IsNumeric(Text1(n + 5).Text) Then Cancel = True ElseIf CDbl(Text1(n + 5).Text) < 0 Then Cancel = True End If If Cancel Then MsgBox "Por favor, escriba un dato numérico correcto", vbExclamation h = h + 1 Cancel = False End If If Not IsNumeric(Text1(n + 6).Text) Then Cancel = True ElseIf CDbl(Text1(n + 6).Text) < 0 Then Cancel = True End If If Cancel Then MsgBox "Por favor, escriba un dato numérico correcto", vbExclamation h = h + 1 Cancel = False End If If Not IsNumeric(Text1(n + 7).Text) Then Cancel = True ElseIf CDbl(Text1(n + 7).Text) < 0 Then Cancel = True End If If Cancel Then MsgBox "Por favor, escriba un dato numérico correcto", vbExclamation h = h + 1 Cancel = False End If If Not IsNumeric(Text1(n + 8).Text) Then Cancel = True ElseIf CDbl(Text1(n + 8).Text) < 0 Then Cancel = True End If If Cancel Then MsgBox "Por favor, escriba un dato numérico correcto", vbExclamation h = h + 1 Cancel = False End If If Not IsNumeric(Text1(n + 10).Text) Then Cancel = True ElseIf CDbl(Text1(n + 10).Text) < 0 Then Cancel = True End If If Cancel Then MsgBox "Por favor, escriba un dato numérico correcto", vbExclamation h = h + 1 Cancel = False End If n = n + 9 Next n If h = 0 Then For n = 0 To ultimo - 10 vupdate = "UPDATE PIEZA SET DESCRIPCION_PIEZA = '" & Text1(n + 2) & "', UNIDADES = " & Text1(n + 3) & ", MEDIDA1 = '" & CDbl(Text1(n + 5)) & "', MEDIDA2 = '" & CDbl(Text1(n + 6)) & "', ESPESOR = '" & CDbl(Text1(n + 7)) & "', LONGITUD = '" & CDbl(Text1(n + 8)) & "' WHERE ID_PIEZA = " & Text1(n + 1) rsiproceso.Open " " & vupdate & " ", conn, adOpenDynamic, adLockBatchOptimistic Set rsiproceso = Nothing Set rsiproceso = New ADODB.Recordset n = n + 9 Next n For n = 0 To ultimo - 10 vupdate = "UPDATE PROCESO SET TIEMPO = '" & Text1(n + 10) & "' WHERE ID_PROCESO = " & Text1(n + 4) rsiproceso.Open " " & vupdate & " ", conn, adOpenDynamic, adLockBatchOptimistic Set rsiproceso = Nothing Set rsiproceso = New ADODB.Recordset n = n + 9 Next n conn.Close Form6.Visible = False MsgBox "Las modificaciones se han efectuado correctamente.", vbExclamation End If End Sub Private Function tabla(mult As Byte) As String() 'Función para pasar los datos modificables de la tabla a un array Dim arr() As String, i As Integer Dim ultimo As Integer ultimo = Text1.Count - 1 ReDim arr(0 To ultimo - 1) For i = 0 To ultimo - 1 arr(i) = Text1(i + 1) Next i tabla = arr End Function Private Sub Command2_Click() Form6.Visible = False End Sub Private Sub Form_Load() ' centrar el formulario en la parte superior Move (Screen.Width - Width) \ 2, 1500 End Sub e-REdING. Biblioteca de la Escuela Superior de Ingenieros de Sevilla.


GESTIÓN Y OPTIMIZACIÓN DE LA PRODUCCIÓN EN UNA FÃBRICA DE ESTRUCTURAS METÃLICAS DE SILLERÃA

: Narbona Fernández, Jesús
: Ingeniería Organización
Contenido del proyecto: