Try
            If myCn.State <> ConnectionState.Open Then
                myCn.Open()
            End If
            If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or TextBox6.Text = "" Then
                MsgBox("All Fields Are Required")
            Else
                strsql = "Update Prod set prod_name ='" + TextBox1.Text + "', comp_name = '" + TextBox2.Text + "',cost_item = '" + TextBox3.Text + "',mfg_date = '" + DateTimePicker1.Value + "',exp_date = '" + DateTimePicker2.Value + "',min_stock= '" + TextBox4.Text + "', max_stock='" + TextBox5.Text + "',stock_hand='" + TextBox6.Text + "'WHERE prod_num = '" + TextBox7.Text + "'"
                da = New OleDbDataAdapter(strsql, myCn)
                da.Fill(ds)
                'Me.Hide()
                'Form2.list()
                MsgBox("Saved")
                If myCn.State = ConnectionState.Open Then
                    myCn.Close()
                End If

            End If
        Catch ex As Exception
            MsgBox("Error in edit" + ex.Message)
        End Try

I have problem with this, I'm trying is to change the product details. But there is this error popping up when i'm trying to edit. error in editData type mismatch in criteria expression.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.