Aplicacion Ing Civil

15
INGENIERIA CIVIL - PROGRAMACION DIGITAL APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR” Magister Ing. Lic. Dante Enrique Romero Aguilar Página 1 1. Diseño de la interfaz de validación de usuario (manejo de conexión a la base datos con la referencia ADO) Módulos: Declaraciones Global base As New ADODB.Connection Global RsUsuarios As New ADODB.Recordset Global MU2 As Double Sentencias Sub main() With base .CursorLocation = adUseClient .Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb;Persist Security Info=False"

Transcript of Aplicacion Ing Civil

Page 1: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 1

1. Diseño de la interfaz de validación de usuario (manejo de conexión a la base datos

con la referencia ADO)

Módulos:

Declaraciones Global base As New ADODB.Connection

Global RsUsuarios As New ADODB.Recordset

Global MU2 As Double

Sentencias Sub main()

With base

.CursorLocation = adUseClient

.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb;Persist

Security Info=False"

Page 2: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 2

LoginForm.Show

End With

End Sub

Sub usuario()

With RsUsuarios

If .State = 1 Then .Close

.Open "select * from usuarios", base, adOpenStatic, adLockOptimistic

End With

End Sub

Formulario login:

Private Sub CmdAceptar_Click() If txtid.Text = "" Then MsgBox "ingrese un Id de Usuario", vbInformation, "Aviso": txtid.SetFocus: Exit Sub If txtclave.Text = "" Then MsgBox "ingrese una Clave", vbInformation, "Aviso": txtclave.SetFocus: Exit Sub With RsUsuarios .Requery .Find "Id='" & Trim(txtid.Text) & "'" If .EOF Then MsgBox "usuario Incorrecto", vbInformation, "aviso" Else If !clave = Trim(txtclave.Text) Then Unload Me frmPrincipal.Show Else MsgBox "clave incorrecta", vbInformation, "aviso" End If End If End With End Sub Private Sub CmdCancelar_Click() Unload Me End Sub Private Sub Form_Load() usuario End Sub

Page 3: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 3

2. Creación de la interfaz principal (MDIPrincipal)

Código del Menú 2 tramos:

Private Sub Nmudos_Click() FRmVR2.Show End Sub

3. Implementación del formulario FRmVr2:

Page 4: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 4

Codificación:

Private Sub cmdCerrar_Click() FRmVR2.Hide End Sub Private Sub CmdAceptar_Click() If OpAligerado.Value = True Then If Val(LozaPeralte.Text) = 0.17 Then Rloza.Text = 280 ElseIf Val(LozaPeralte.Text) = 0.2 Then Rloza.Text = 300 ElseIf Val(LozaPeralte.Text) = 0.25 Then Rloza.Text = 350 Else Rloza.Text = 420 End If Else Rloza.Text = 2400 * Val(LozaPeralte.Text) End If If OpTipico.Value = True Then PPterminado.Text = (Val(PisoTerm.Text) * Val(ATPisoterm.Text)) / 1000 Else PPterminado.Text = (Val(Cobertura.Text) * Val(ATPisoterm.Text)) / 1000 End If Ploza.Text = (Val(Rloza.Text) * Val(ATloza.Text)) / 1000 PCieloRazo.Text = (Val(CieloRazo.Text) * Val(ATCR.Text)) / 1000 PPviga.Text = 2400 * (Val(Vbase.Text) * Val(Vperalte.Text)) / 1000 CPmuro.Text = (Val(PMuro.Text) * Val(AMuro.Text) * Val(EMuro.Text)) / 1000 WD.Text = Val(PPterminado.Text) + Val(Ploza.Text) + Val(PCieloRazo.Text) + Val(PPviga.Text) + Val(CPmuro.Text) PSCarga.Text = (Val(ATSC.Text) * Val(Scarga.Text)) / 1000 PTabMovil.Text = (Val(ATSC.Text) * Val(TabMovil.Text)) / 1000 WL.Text = Val(PSCarga.Text) + Val(PTabMovil.Text) WU = 1.4 * Val(WD.Text) + 1.7 * Val(WL.Text) LblWU1.Caption = "WU:" & Val(WU.Text) lblWU2.Caption = "WU:" & Val(WU.Text) If EV1.Value = True Then M1.Text = Val(txtLuz1.Text) * Val(txtLuz1.Text) * Val(WU.Text) / 24 ElseIf EC1.Value = True Then M1.Text = Val(txtLuz1.Text) * Val(txtLuz1.Text) * Val(WU.Text) / 16 Else M1.Text = 0 End If If N1.Value = True Then M2.Text = Val(txtLuz1.Text) * Val(txtLuz1.Text) * Val(WU.Text) / 11

Page 5: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 5

Else M2.Text = Val(txtLuz1.Text) * Val(txtLuz1.Text) * Val(WU.Text) / 14 End If MU2 = Val(M2.Text) M3.Text = Val(txtLuz1.Text) * Val(txtLuz1.Text) * Val(WU.Text) / 9 M4.Text = Val(txtluz2.Text) * Val(txtluz2.Text) * Val(WU.Text) / 9 If N2.Value = True Then M5.Text = Val(txtluz2.Text) * Val(txtluz2.Text) * Val(WU.Text) / 11 Else M5.Text = Val(txtluz2.Text) * Val(txtluz2.Text) * Val(WU.Text) / 14 End If If EV2.Value = True Then M6.Text = Val(txtluz2.Text) * Val(txtluz2.Text) * Val(WU.Text) / 24 ElseIf EC2.Value = True Then M6.Text = Val(txtluz2.Text) * Val(txtluz2.Text) * Val(WU.Text) / 16 Else M6.Text = 0 End If End Sub Private Sub Command2_Click() frmLuz.Show End Sub Private Sub Command3_Click() frmextremo.Show End Sub

4. Diseño del formulario del Tramo Ext. Izquierdo.

Page 6: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 6

Private Sub cmdDR_Click() frmDR.Show End Sub Private Sub cmdGuardar_Click() frmGtramo.Show End Sub Private Sub cmdRS_Click() frmRS.Show End Sub Private Sub cmdSiguiente_Click() Unload Me frmextizq.Show End Sub Private Sub Command1_Click() b = Val(txtb.Text) Fy = Val(txtfy.Text) Fc = Val(cbofc.Text) MU = Val(txtMup.Text) 'calculando d' If Val(txtMup.Text) < 50 Then txtd.Text = Val(txth.Text) - 6 Else txtd.Text = Val(txth.Text) - 9 End If d = Val(txtd.Text) 'calculado B1' If Val(cbofc.Text) <= 280 Then txtB1.Text = 0.85 ElseIf Val(cbofc.Text) <= 350 Then txtB1.Text = 0.85 + (Val(cbofc.Text) - 280) * (0.8 - 0.85) / 70 ElseIf Val(cbofc.Text) <= 420 Then txtB1.Text = 0.8 + (Val(cbofc.Text) - 350) * (0.75 - 0.8) / 70 ElseIf Val(cbofc.Text) <= 490 Then txtB1.Text = 0.75 + (Val(cbofc.Text) - 420) * (0.7 - 0.75) / 70 ElseIf Val(cbofc.Text) <= 560 Then txtB1.Text = 0.7 + (Val(cbofc.Text) - 490) * (0.65 - 0.7) / 70 Else txtB1.Text = 0.65 End If b1 = Val(txtB1.Text) 'calculo de w' Dim c, w, p As Double c = (Val(txtMup.Text) * 100000) / (0.9 * Val(cbofc.Text) * Val(txtb.Text) * (Val(txtd.Text)) ^ 2) w = (1 - Sqr(1 - 4 * 0.59 * c)) / (2 * 0.59) 'txtw.Text = w' 'txtc.Text = c' txtp.Text = w * Val(cbofc.Text) / (txtfy.Text) p = w * Val(cbofc.Text) / (txtfy.Text) cuan = w * Val(cbofc.Text) / (txtfy.Text) 'calculo de Area de acero' txtAs.Text = p * Val(txtb.Text) * Val(txtd.Text) AAcero = p * Val(txtb.Text) * Val(txtd.Text) 'calculamos p minimo,AreaSmin' txtpmin.Text = 0.7 * Sqr(Val(cbofc.Text)) / Val(txtfy.Text) pmin = 0.7 * Sqr(Val(cbofc.Text)) / Val(txtfy.Text)

Page 7: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 7

txtAsmin.Text = Val(txtpmin.Text) * Val(txtb.Text) * Val(txtd.Text) AAsmin = Val(txtpmin.Text) * Val(txtb.Text) * Val(txtd.Text) txtpbal.Text = (0.85 * Val(cbofc.Text) * Val(txtB1.Text) * 6000) / (Val(txtfy.Text) * (6000 + Val(txtfy.Text))) pbal = (0.85 * Val(cbofc.Text) * Val(txtB1.Text) * 6000) / (Val(txtfy.Text) * (6000 + Val(txtfy.Text))) txtpmax.Text = 0.75 * Val(txtpbal.Text) pmax = 0.75 * Val(txtpbal.Text) txtAsmax.Text = Val(txtpmax.Text) * Val(txtb.Text) * Val(txtd.Text) AAsmax = Val(txtpmax.Text) * Val(txtb.Text) * Val(txtd.Text) 'refuerzos segun el Area de acero' If Val(txtAs.Text) <= Val(txtAsmax.Text) And Val(txtAs.Text) >= Val(txtAsmin.Text) Then MsgBox "Simplemente Reforzada", vbInformation, "aviso" ElseIf Val(txtAs.Text) < Val(txtAsmin.Text) Then MsgBox "Simplemente reforzada con area de acero minimo", vbInformation, "aviso" Else MsgBox "refuerzo doble", vbInformation, "aviso" End If cmdRS.Enabled = True cmdSiguiente.Enabled = True cmdDR.Enabled = True cmdguardar.Enabled = True End Sub Private Sub Form_Load() txtMu.Text = MU2 End Sub Private Sub txtb_Change() lblb.Caption = "b=" & Val(txtb.Text) End Sub Private Sub txth_Change() Lblh.Caption = "h=" & Val(txth.Text) End Sub

5. Base Datos:

Page 8: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 8

6. Agregación de variables globales en el módulo:

Global base As New ADODB.Connection Global RsUsuarios As New ADODB.Recordset Global rsProyectos As New ADODB.Recordset Global Rstramos As New ADODB.Recordset Global Rsrefuerzos As New ADODB.Recordset Global Rsvarillas As New ADODB.Recordset Global Rsdetallerefuerzo As New ADODB.Recordset Global MU2, GWD, GWL, GWU, Mom1, Mom2, Mom3, Mom4, Mom5, Mom6 As Double 'centro de luz' Global AAcero, pmax, pmin, AAsmin, pbal, AAsmax As Double Global b, d, Fy, Fc, MU, b1, cuan As Double 'extremo izquierdo' Global AAceroi, pmaxi, pmini As Double Global bi, di, Fyi, Fci, MUi, b1i As Double

7. Implementación del modulo sentencias:

Sub Proyecto() With rsProyectos If .State = 1 Then .Close .Open "select * from Proyectos", base, adOpenStatic, adLockOptimistic End With End Sub Sub tramo() With Rstramos If .State = 1 Then .Close .Open "select * from Tramos", base, adOpenStatic, adLockOptimistic End With End Sub Sub refuerzo() With Rsrefuerzos If .State = 1 Then .Close .Open "select * from refuerzos", base, adOpenStatic, adLockOptimistic End With End Sub Sub detalleref() With Rsdetallerefuerzo If .State = 1 Then .Close .Open "select * from detalle_refuerzo", base, adOpenStatic, adLockOptimistic End With End Sub Sub varilla() With Rsvarillas If .State = 1 Then .Close .Open "select * from varillas", base, adOpenStatic, adLockOptimistic End With End Sub

Page 9: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 9

8. Implementación de la Interfaz centro de luz del tramo 1.

Codificacion similar a la del ext.izquierdo

9. Si en el tramo el refuerzo es simple

Private Sub cmdcalcular_Click() 'Numero de varillas' Dim v1, v2, v3, v4, v5 As Double v1 = Round(AAcero / 0.71, 0) + 1 lblv1.Caption = v1 & " " & "Var" v2 = Round(AAcero / 1.29, 0) + 1 lblv2.Caption = v2 & " " & "Var" v3 = Round(AAcero / 1.99, 0) + 1 lblv3.Caption = v3 & " " & "Var" v4 = Round(AAcero / 2.84, 0) + 1 lblv4.Caption = v4 & " " & "Var" v5 = Round(AAcero / 5.09, 0) + 1 lblv5.Caption = v5 & " " & "Var"

Page 10: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 10

'Condicion segun varillas' If ((b - 2 * Val(txtrc.Text) - v1 * 0.9525) / (v1 - 1)) >= 2.5 Then lblcond1.Caption = "UNA CAPA" ElseIf ((b - 2 * Val(txtrc.Text) - Round((v1) / 2, 0) * 0.9525) / (Round((v1) / 2, 0) - 1)) >= 2.5 Then lblcond1.Caption = "DOS CAPAS" Else lblcond1.Caption = "NO CUMPLE" End If If ((b - 2 * Val(txtrc.Text) - v2 * 1.27) / (v2 - 1)) >= 2.5 Then lblcond2.Caption = "UNA CAPA" ElseIf ((b - 2 * Val(txtrc.Text) - Round((v2) / 2, 0) * 1.27) / (Round((v2) / 2, 0) - 1)) >= 2.5 Then lblcond2.Caption = "DOS CAPAS" Else lblcond2.Caption = "NO CUMPLE" End If If ((b - 2 * Val(txtrc.Text) - v3 * 1.5875) / (v3 - 1)) >= 2.5 Then lblcond3.Caption = "UNA CAPA" ElseIf ((b - 2 * Val(txtrc.Text) - Round((v3) / 2, 0) * 1.5875) / (Round((v3) / 2, 0) - 1)) >= 2.5 Then lblcond3.Caption = "DOS CAPAS" Else lblcond3.Caption = "NO CUMPLE" End If If ((b - 2 * Val(txtrc.Text) - v4 * 1.905) / (v4 - 1)) >= 2.5 Then lblcond4.Caption = "UNA CAPA" ElseIf ((b - 2 * Val(txtrc.Text) - Round((v4) / 2, 0) * 1.905) / (Round((v4) / 2, 0) - 1)) >= 2.5 Then lblcond4.Caption = "DOS CAPAS" Else lblcond4.Caption = "NO CUMPLE" End If If ((b - 2 * Val(txtrc.Text) - v5 * 2.54) / (v5 - 1)) >= 2.5 Then lblcond5.Caption = "UNA CAPA" ElseIf ((b - 2 * Val(txtrc.Text) - Round((v5) / 2, 0) * 2.54) / (Round((v5) / 2, 0) - 1)) >= 2.5 Then lblcond5.Caption = "DOS CAPAS" Else lblcond5.Caption = "NO CUMPLE" end if end sub

10.Refuerzo doble

Page 11: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 11

Private Sub cmdcalcular_Click() 'Numero de varillas' Dim v1, v2, v3, v4, v5 As Double v1 = Round(Val(txtASc.Text) / 0.71, 0) + 1 Lbl1.Caption = v1 & " " & "Var" v2 = Round(Val(txtASc.Text) / 1.29, 0) + 1 lbl2.Caption = v2 & " " & "Var" v3 = Round(Val(txtASc.Text) / 1.99, 0) + 1 lbl3.Caption = v3 & " " & "Var" v4 = Round(Val(txtASc.Text) / 2.84, 0) + 1 lbl4.Caption = v4 & " " & "Var" v5 = Round(Val(txtASc.Text) / 5.09, 0) + 1 lbl5.Caption = v5 & " " & "Var" 'Condicion segun varillas' If ((b - 2 * Val(txtRec.Text) - v1 * 0.9525) / (v1 - 1)) >= 2.5 Then lblcon1.Caption = "UNA CAPA" ElseIf ((b - 2 * Val(txtRec.Text) - Round((v1) / 2, 0) * 0.9525) / (Round((v1) / 2, 0) - 1)) >= 2.5 Then lblcon1.Caption = "DOS CAPAS" Else lblcon1.Caption = "NO CUMPLE" End If If ((b - 2 * Val(txtRec.Text) - v2 * 1.27) / (v2 - 1)) >= 2.5 Then lblcon2.Caption = "UNA CAPA" ElseIf ((b - 2 * Val(txtRec.Text) - Round((v2) / 2, 0) * 1.27) / (Round((v2) / 2, 0) - 1)) >= 2.5 Then lblcon2.Caption = "DOS CAPAS" Else lblcon2.Caption = "NO CUMPLE" End If If ((b - 2 * Val(txtRec.Text) - v3 * 1.5875) / (v3 - 1)) >= 2.5 Then lblcon3.Caption = "UNA CAPA" ElseIf ((b - 2 * Val(txtRec.Text) - Round((v3) / 2, 0) * 1.5875) / (Round((v3) / 2, 0) - 1)) >= 2.5 Then lblcon3.Caption = "DOS CAPAS" Else lblcon3.Caption = "NO CUMPLE" End If If ((b - 2 * Val(txtRec.Text) - v4 * 1.905) / (v4 - 1)) >= 2.5 Then lblcon4.Caption = "UNA CAPA" ElseIf ((b - 2 * Val(txtRec.Text) - Round((v4) / 2, 0) * 1.905) / (Round((v4) / 2, 0) - 1)) >= 2.5 Then lblcon4.Caption = "DOS CAPAS" Else lblcon4.Caption = "NO CUMPLE" End If If ((b - 2 * Val(txtRec.Text) - v5 * 2.54) / (v5 - 1)) >= 2.5 Then lblcon5.Caption = "UNA CAPA" ElseIf ((b - 2 * Val(txtRec.Text) - Round((v5) / 2, 0) * 2.54) / (Round((v5) / 2, 0) - 1)) >= 2.5 Then lblcon5.Caption = "DOS CAPAS" Else lblcon5.Caption = "NO CUMPLE" End If cmdGuardar.Enabled = True End Sub Private Sub cmdGuardar_Click() refuerzo

Page 12: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 12

varilla detalleref With Rsdetallerefuerzo .Requery .AddNew !N°_varilla = 1 !Id_refuerzo = "Doble" !N_varilla = Lbl1.Caption !Condicion = lblcon1.Caption .AddNew !N°_varilla = 2 !Id_refuerzo = "Doble" !N_varilla = lbl2.Caption !Condicion = lblcon2.Caption .AddNew !N°_varilla = 3 !Id_refuerzo = "Doble" !N_varilla = lbl3.Caption !Condicion = lblcon3.Caption .AddNew !N°_varilla = 4 !Id_refuerzo = "Doble" !N_varilla = lbl4.Caption !Condicion = lblcon4.Caption .AddNew !N°_varilla = 5 !Id_refuerzo = "Doble" !N_varilla = lbl5.Caption !Condicion = lblcon5.Caption .Update .Requery End With End Sub Private Sub cmdSiguiente_Click() Unload Me frmextizq.Show End Sub Private Sub Form_Load() Dim As1, a, MU2, ASp As Double txtAs1.Text = pmax * b * d As1 = Val(txtAs1.Text) txta.Text = (As1 * Fy) / (0.85 * Fc * b) a = (As1 * Fy) / (0.85 * Fc * b) txtMU1.Text = (0.9 * (As1 * Fy * (d - (a / 2)))) / 100000 txtMu2.Text = MU - Val(txtMU1.Text) MU2 = txtMu2.Text txtASp.Text = (MU2 / (0.9 * Fy * (d - 6))) * 100000 ASp = (MU2 / (0.9 * Fy * (d - 6))) * 100000 txtASc.Text = Val(txtAs1.Text) + ASp txtp1.Text = Val(txtASp.Text) / (b * d) txtpc.Text = Val(txtASc.Text) / (b * d) txtp_p.Text = Val(txtpc.Text) - Val(txtp1.Text) txtFac.Text = (0.85 * Fc * 6000 * 6 * b1) / (Fy * d * (6000 - Fy)) If Val(txtp_p.Text) > Val(txtFac.Text) Then lblsim.Caption = ">" Lblcond.Caption = "EL ACERO A COMPRESIÓN FLUYE: OK"

Page 13: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 13

ElseIf (txtp_p.Text) < Val(txtFac.Text) Then lblsim.Caption = "<" Lblcond.Caption = "EL ACERO A COMPRESIÓN NO FLUYE: OK" Else lblsim.Caption = "=" Lblcond.Caption = "EL ACERO A COMPRESIÓN FLUYE: OK" End If cmdGuardar.Enabled = False End Sub

11. Crear Nuevo usuario

Private Sub cmdIngresar_Click() If txtNId.Text = "" Then MsgBox "el campo Id no puede estar vacio", vbInformation, "aviso":

txtNId.SetFocus If txtNClave.Text = "" Then MsgBox "el campo clave no puede estar vacio", vbInformation, "aviso":

txtNClave.SetFocus With RsUsuarios .Requery .AddNew !Id = txtNId.Text !Clave = txtNClave.Text .Update .Requery End With End Sub Private Sub cmdSalir_Click() Unload Me End Sub Private Sub Form_Load() usuario Set GrillaUsuarios.DataSource = RsUsuarios End Sub

Page 14: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 14

12. Grabar Proyecto

Private Sub Command1_Click() If txtIDProy.Text = "" Then MsgBox "el campo Id no puede estar vacio", vbInformation, "aviso":

txtIDProy.SetFocus With rsProyectos .Requery .AddNew !Id_Proyecto = txtIDProy.Text !CV = Val(txtWD.Text) !CM = Val(txtWL.Text) !CU = Val(txtWU.Text) !MO1 = Val(txtm1.Text) !MO2 = Val(txtm2.Text) !MO3 = Val(txtm3.Text) !MO4 = Val(txtm4.Text) !MO5 = Val(txtm5.Text) !MO6 = Val(txtm6.Text) .Update .Requery End With Unload Me End Sub Private Sub Form_Load() txtWD.Text = GWD txtWL.Text = GWL txtWU.Text = GWU txtm1.Text = Mom1 txtm2.Text = Mom2 txtm3.Text = Mom3 txtm4.Text = Mom4 txtm5.Text = Mom5 txtm6.Text = Mom6 Proyecto End sub

Page 15: Aplicacion Ing Civil

INGENIERIA CIVIL - PROGRAMACION DIGITAL

APLICACIÓN N° 1- “DISEÑO A FLEXION DE UNA VIGA RECTANGULAR”

Magister Ing. Lic. Dante Enrique Romero Aguilar Página 15

13. Guardar diseño a flexión según tramo. Private Sub CmdGuardarB_Click() If txtIdTramo.Text = "" Then MsgBox "el campo Idtramo no puede estar vacio", vbInformation, "aviso":

txtIDProy.SetFocus With Rstramos .Requery .AddNew !Id_Proyecto = DCproyectotramo.Text !Id_Tramos = txtIdTramo.Text !L_D = Val(txtd.Text) !A_Acero = Val(txtAs.Text) !C_B1 = Val(txtB1.Text) !Cuantia = Val(txtp.Text) !Cuantia_min = Val(txtpmin.Text) !Cuantia_max = Val(txtpmax.Text) !Cuantia_balanc = Val(txtpbal.Text) !A_Acero_min = Val(txtAsmin.Text) !A_Acero_max = Val(txtAsmax.Text) .Update .Requery End With Unload Me End Sub Private Sub Form_Load() Proyecto Set DCproyectotramo.RowSource = rsProyectos DCproyectotramo.BoundColumn = "Id_proyecto" DCproyectotramo.ListField = "Id_proyecto" txtd.Text = d txtB1.Text = b1 txtp.Text = cuan txtAs.Text = AAcero txtpmin.Text = pmin txtAsmin.Text = AAsmin txtpbal.Text = pbal txtpmax.Text = pmax txtAsmax.Text = AAsmax tramo end sub