Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Private Sub Command1_Click()

Text6.Text = Year(Date)

A = Val(Text5.Text)

b = Val(Text8.Text)

c = Val(Text4.Text)

d = Val(Text7.Text)

e = Val(Text3.Text)

f = Val(Text6.Text)

If (A >= b) Then

Text11.Text = A - b

Else

txxt11.Text = (A + Val(30) - b)

d = d * Val(1)

End If

If (c >= d) Then

Text10.Text = c - d

Else

Text10.Text = (c + Val(12) - d)

f = f + Val(1)

End If

Text9.Text = e - f

End Sub

Private Sub Text11_KeyPress(KeyAscii As Integer)

If (KeyAscii = 13) Then

If (IsNumeric(Text1.Text)) Then

MsgBox ("error ingrse solo letras")

Text1.Text = ""

Text1.SetFocus

Else

Text2.SetFocus

MsgBox ("error solo numeros")

Text3.Text = ""

Text3.SetFocus
End If

Else

End If

End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)

If (KeyAscii = 13) Then

If (IsNumeric(Text4.Text)) Then

If (vaal(Text4, Text) >= 0) Then

Text5.SetFocus

Else

MsgBox ("error solo numeros positivos ")

Text4 , Text = ""

Text4.SetFocus

End If

Else

MsgBox ("error solo numeros")

Text4.Text = ""

Text4.SetFocus

End If

Else

End If

End Sub

End Sub

End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)

If (KeyAscii = 13) Then

If IsNumeric(Text6, Text) Then

If (Val(Text6.Text) > 0) Then

Text7.SetFocus

Else

msgnox ("error ingrse solo positivos")

Text6.Text = ""

Text6.SetFocus
End If

Else

MsgBox ("error ingrse solo numeros")

Text6.Text = ""

Text6.SetFocus

End If

Else

End If

End Sub

End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)

If (KeyAscii = 13) Then

If (IsNumeric(Text7.Text)) Then

If (Val(Text7.Text) >= 0) Then

Text8.SetFocus

Else

MsgBox ("error solo numeros positivos")

Text7.Text = ""

Text7.SetFocus

End If

Else

MsgBox ("erros solo numeros")

Text7.Text = ""

Text7.SetFocus

End If

Else

End If

End Sub

Private Sub Text8_KeyPress(KeyAscii As Integer)

If (KeyAscii = 13) Then

If (IsNumeric(Text8.Text)) Then

If (Val(Text8.Text) >= 0) Then

Else
MsgBox ("error solo numerospositivos")

Text8.Text = ""

Text8.SetFocus

End If

Else

MsgBox ("error solo numeros ")

Text8.Text = ""

Text8.SetFocus

End If

Else

End If

End Sub

You might also like