投稿日 | : 2003/08/18(Mon) 22:46 |
投稿者 | : 花ちゃん |
Eメール | : |
URL | : |
タイトル | : Re: 計算結果がなぜか0になる?? |
説明はしませんので、ご自分で考えて下さい。
Option Explicit
Private s As Double
Private t As Double
Private Sub Command1_Click()
Dim u As Double
u = s + t
Debug.Print u
End Sub
Private Sub Text1_Change()
If Len(Text1.Text) >= 3 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
KeyAscii = 0
s = Val(Text1.Text & "." & Text2.Text)
Debug.Print s
Text3.SetFocus
End If
End Sub
Private Sub Text3_Change()
If Len(Text3.Text) >= 2 Then
Text4.SetFocus
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
KeyAscii = 0
t = Val(Text3.Text & "." & Text4.Text)
Debug.Print t
Command1.SetFocus
End If
End Sub