类型不匹配错误
form11中的代码Private Sub 确定_Click()
w = Text2.Text
Form1.Show
Unload Me
End Sub
form1中的代码
Private Sub Picture1_Paint()
Dim p As Single
w = Form11.Text2.Text
Dim t, ρ, x2, y2 As Single
For ρ = 100 To 0 Step -10
If ρ = 100 Then
For t = -20 To 65 Step 0.02
Pq = Pk(t)
x2 = 622 * Pq / (w - Pq)
y2 = t + x2 / 2000 * (2500 + 1.84 * t) - x2
If x2 <= 42 And y2 <= 65 Then
Picture1.PSet (x2, y2), QBColor(4)
Else
Picture1.CurrentX = x2: Picture1.CurrentY = y2 + 1: Picture1.Print ρ; "%"
Exit For
End If
Next t
Else
For t = -20 To 65 Step 0.02
Pq = Pk(t)
x2 = 622 * Pq * (ρ / 100) / (w - Pq * ρ / 100)
y2 = t + x2 / 2000 * (2500 + 1.84 * t) - x2
Next t
End If
Next ρ
运行时老是出现类型不匹配的错误,哪里错了呢?