Expressing another formula

Ray
12-06-2002, 05:43 PM
On another form on my project I want to modify
the present formula and have it returned to
the textbox.

Here is the present code:
If Text1.Text = "" Then MsgBox "Please Enter A Frequency In The Range 1.8 - 30 MHZ": Exit Sub
Dim sngFeet As Single
Dim sngInches As Single

sngFeet = 468 / CSng(Text1.Text) 'Your "decimal feet"
sngInches = sngFeet - Int(sngFeet) 'Get the decimal part of that

sngInches = Format(sngInches * 12, "0.000") 'Convert it to inches and limit the number of decimals to 3
sngFeet = Int(sngFeet) 'Cutting off the decimal part of the feet

Label2.Caption = sngFeet & " Feet " & sngInches & " Inches" 'displaying result
Label2.Caption = sngFeet & " Feet " & sngInches & " Inches"
'displaying result
sngFeet = sngFeet / 2
sngInches = sngInches / 2

Label1.Caption = sngFeet & " Feet " & sngInches & " Inches"
End Sub

I want the present answer that's produced to be
reduced by 4% before it's displayed.

Any Idea's??

Thanks Again
Ray

OnErr0r
12-06-2002, 06:05 PM
Originally posted by Ray
On another form on my project I want to modify
the present formula and have it returned to
the textbox.

Here is the present code:
If Text1.Text = "" Then MsgBox "Please Enter A Frequency In The Range 1.8 - 30 MHZ": Exit Sub
Dim sngFeet As Single
Dim sngInches As Single

sngFeet = 468 / CSng(Text1.Text) 'Your "decimal feet"
sngInches = sngFeet - Int(sngFeet) 'Get the decimal part of that

sngInches = Format(sngInches * 12, "0.000") 'Convert it to inches and limit the number of decimals to 3
sngFeet = Int(sngFeet) 'Cutting off the decimal part of the feet

Label2.Caption = sngFeet & " Feet " & sngInches & " Inches" 'displaying result
Label2.Caption = sngFeet & " Feet " & sngInches & " Inches"
'displaying result
sngFeet = sngFeet / 2
sngInches = sngInches / 2

Label1.Caption = sngFeet & " Feet " & sngInches & " Inches"
End Sub

I want the present answer that's produced to be
reduced by 4% before it's displayed.



Sounds like a 1/4 wave antenna calculation :)

Multiply by .96 (or 96%)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum