View Single Post
  #2 (permalink)  
Old 10-22-2007, 10:31 AM
stbi stbi is offline
Junior Member
 
Join Date: Apr 2007
Location: Germany
Posts: 34
Default

So funktionierts bei mir:

Sub Btn1berech_Click
If txt1cosphi.Text > 1 Then Msgbox ("Cos Phi nicht größer als 1",OK)
If txt1cosphi.Text = 0 Then txt1cosphi.Text = 1
If txt1span.Text = 24 Then txt1Leist.Text = txt1Span.Text * txt1Strom.Text / 1000
If txt1span.Text = 230 Then txt1Leist.Text = txt1Span.Text * txt1Strom.Text * txt1cosphi.Text / 1000
If txt1span.Text = 400 Then txt1Leist.Text = txt1Span.Text * txt1Strom.Text * txt1cosphi.Text * Sqrt(3) / 1000
End Sub


Erels Vorschlag war schon richtig, nur musst Du die .Text-Methode auch bei der If-Abfrage anwenden.

Rechnen mit Textvariablen ist aber auch nicht ganz so die sauberste Art zu programmieren
__________________
iPAQ 6515, MDA compact
Reply With Quote