Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Simple Boolean Logic

$
0
0
hey guys, ive made this form with two textbox's called ( age and RHR ) im asking the client two insert two values and see whether and then hit continue, it seems right but when the two message boxes come up the program gets an error. i cant understand what the error means. i know its probably something silly but yeah. All help appreciated :D


Public Class HeartData

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim A1 As Boolean
        Dim A2 As Boolean
        

        If age.Text = "" Then
            MsgBox("Please Insert Your Age")
            A1 = False
        End If

        If RHR.Text = "" Then
            MsgBox("Please Insert Your Resting Heart Rate")
            A2 = False
        Else : A2 = True
        End If
        If Age.Text < 0 Then
            MsgBox(" Invalid Age ")
            A1 = False
        Else : A1 = True
        End If
        If Age.Text > 50 Then
            MsgBox(" Your Too Old To Be Using My Program ")
            A1 = False
        Else : A1 = True
        End If

        If A1 And A2 = True Then
            MsgBox(" Thank You For Your Support")
            HeartForm.Show()
            Me.Hide()

        End If

    End Sub


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>