Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27072

IF, then, Else Functions errors

$
0
0
This may seem like a stupid question but I can't seem to get the IF function to work. I got it to work in an earlier section:
Code:

If txtSat1.Text = "" Then
            If txtSat2.Text = "" Then
                If cbSat.CheckState = 0 Then
                    MessageBox.Show("Please Enter Hours for Saturday")
                End If
            End If
        End If

but with my current code here:
Code:

If txtSun1.Text <> Then
            cbSun.CheckState = 0
            Else If txtSun2.Text <> Then
            cbSun.CheckState = 0
        End If

Both the "Then"s are underline blue and it says "expression expected." I have two textboxes and a checkbox. If the user types something into either one of the textboxes, then I want the checkbox to not be able to be clicked. Any help would be appreciated.

Viewing all articles
Browse latest Browse all 27072

Trending Articles



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