If txt1.Text = "" Or txt2.Text = "" Or txt3.Text = "" _
Or txt4.Text = "" Or txt5.Text = "" Then

MsgBox "數值不完整,請重新輸入!", 0 + 16, "錯誤"
  txt1.Text = ""
  txt2.Text = ""
  txt3.Text = ""
  txt4.Text = ""
  txt5.Text = ""
  txt1.SetFocus

Else: A = Val(txt1.Text)
B = Val(txt2.Text)
    C = Val(txt3.Text)
    D = Val(txt4.Text)
    E = Val(txt5.Text)
F = A + B(C + D + E) * 1.2
Label顯示.Caption = "你的總分是:" + Str(F)
If A < 0 Or A > 100 Or B < 0 Or B > 100 _
Or C < 0 Or C > 100 Or D < 0 Or D > 100 _
  Or E < 0 Or E > 100 Then
    MsgBox "數值錯誤,請重新輸入!", 0 + 16, "錯誤!"
    txt1.Text = ""
    txt2.Text = ""
    txt3.Text = ""
    txt4.Text = ""
    txt5.Text = ""
    txt1.SetFocus

End If
End If
此程式每次執行至F=A+B+(C+D+E)*1.2時,總出現"型態不符"
的錯誤訊息,請各位高手指點,thanks
arrow
arrow
    全站熱搜

    vbqa 發表在 痞客邦 留言(2) 人氣()