0

DATA TYPE MISMATCH ERROR CRITERIA

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text <> " " And TextBox2.Text <> " " And TextBox3.Text <> " " And TextBox4.Text <> " " And TextBox5.Text <> " " And TextBox6.Text <> " " And TextBox7.Text <> " " And TextBox8.Text <> " " And TextBox9.Text <> " " And TextBox10.Text <> " " And ComboBox4.Text <> " " And ComboBox5.Text <> " " And RichTextBox1.Text <> " " Then
            Dim s As String
            Dim sex As String
            If RadioButton1.Checked = True Then
                sex = "Male"
            Else
                sex = "Female"
            End If
            form3.connect()

            s = "insert into appdetails values(" + TextBox1.Text + "," + TextBox2.Text + ",'" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + sex + "','" + ComboBox4.Text + "','" + TextBox6.Text + "'," + TextBox7.Text + ",'" + TextBox8.Text + "','" + ComboBox5.Text + "','" + RichTextBox1.Text + "'," + TextBox9.Text + "," + TextBox10.Text + ")"
            MsgBox(s)
            form3.update(s)
            MsgBox("Saved Successfully")
            clear()
        Else
            MsgBox("Pls fill all the details")
        End If
    End Sub

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by BitBlt
0

Not enough detail to help. Is this MSAccess VBA? If so, what version of MSAccess are you using? Are you just trying to execute the statement assembled in variable 's'? Are you trying to change the data source for form3? What is the structure of your table 'appdetails'? What are the datatypes of the columns? Is it bound to a control, or to the form? And so on and so on.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.