954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Data mismatch error in access

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
dini.kumar
Newbie Poster
1 post since Sep 2011
Reputation Points: 10
Solved Threads: 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.

BitBlt
Master Poster
711 posts since Feb 2011
Reputation Points: 367
Solved Threads: 109
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: