مشکل با If

Collapse
X
 
  • زمان
  • نمایش
حذف همه
new posts
  • a.dal65

    • 2011/04/29
    • 384
    • 67.00

    پرسش مشکل با If

    با عرض سلام وخسته نباشد
    من این کد رو نوشتم ولی کار نمیکنه
    فکر میکنم مشکل از درست نبودن If ها باشه
    ممنون میشم بگید مشکل کجاست و رفعش کنید.

    کد PHP:
    Private Sub CommandButton5_Click()
    Height = (heightTens * 100) + heightUnits
    weight1 
    = (weight * 0.453592)
    If 
    OptionButton4.Value = True Then
    calories 
    = ((weight1 * 10) + (Height * 6.25) - (age * 5) + 5)
    Exit 
    Sub
    End 
    If
    If 
    OptionButton5.Value = True Then
    calories 
    = ((weight1 * 10) + (Height * 6.25) - (age * 5) - 161)
    Exit 
    Sub
    End 
    If


    If 
    OptionButton9.Value = True Then
    calories1 
    = Math.Round(calories * 1.1)
    Exit 
    Sub
    End 
    If
    If 
    OptionButton10.Value = True Then
    calories1 
    = Math.Round(calories * 1.3)
    Exit 
    Sub
    End 
    If
    If 
    OptionButton11.Value = True Then
    calories1 
    = Math.Round(calories * 1.5)
    Exit 
    Sub
    End 
    If
    If 
    OptionButton12.Value = True Then
    calories1 
    = Math.Round(calories * 1.7)
    Exit 
    Sub
    End 
    If

    If 
    OptionButton6.Value = True Then
    If (calories1 <= 2000) Then calories2 = 0.9 * calories1
    If (calories1 > 2000) Then calories2 = 0.8 * calories1
    protons
    .Caption = Math.Round(0.4 * calories2 / 4)
    Exit 
    Sub
    End 
    If

    If 
    OptionButton7.Value = True Then
    If (calories1 <= 2000) Then calories2 = 0.9 * calories1
    If (calories1 > 2000) Then calories2 = 0.8 * calories1
    protons
    .Caption = Math.Round(0.4 * calories2 / 4)

    Exit 
    Sub
    End 
    If

    If 
    OptionButton8.Value = True Then
    If (calories1 <= 2000) Then calories2 = 0.9 * calories1
    If (calories1 > 2000) Then calories2 = 0.8 * calories1
    protons
    .Caption = Math.Round(0.4 * calories2 / 4)

    Exit 
    Sub
    End 
    If

    End Sub 
    فایل های پیوست شده
  • ali.b

    • 2014/01/12
    • 798

    #2
    سلام
    برای عملیات ریاضی واسه textbox ها باید اونا رو همراهبا کد val بنویسی
    مثل
    کد:
    (val(textbix1))+(val(textbix2))
    [CENTER]
    [/CENTER]

    کامنت

    • rasools13

      • 2017/01/20
      • 360
      • 80.00

      #3
      سلام فایل پیوست رو بررسی کنید
      فایل های پیوست شده
      [CENTER][B]بهترین راه ذخیره زمان(یادگیری)،،حل مشکلات دیگران است
      [COLOR=#0000ff]مشکلات دیگران، روزی مشکلات ما هم خواهد شد[/COLOR][/B][COLOR=#ff0000][B][FONT=arial][/FONT][/B][/COLOR]
      [/CENTER]

      کامنت

      • a.dal65

        • 2011/04/29
        • 384
        • 67.00

        #4
        ممنون
        فقط میدونید چرا وقتی کامند اجرا میشه userform سایزش تغییر میکنه ؟
        یا فقط برای من اینجوزیه ؟

        کامنت

        چند لحظه..