Hi,
I have made a program using vb.net and mysql. But i decided to convert it using access so i can make .exe trial version just in case.
But upon converting i got this error in one specific function
Database
Table Name: Tbl_Attendance
Specific Field Name: F_Date
Objects
Date time picker name: txt_from.Text
Date time picker name: txt_to.Text
Format: yyyy-MM-dd (i.e. 2012-09-05)
I am creating a specific function that once a click a button it will delete records from txt_from.Text to txt_to.Text
This are my codes:
Private Sub btn_ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_ok.Click
If MessageBox.Show("WARNING: Be very careful when deleting records. You cannot undo this procedure!" + vbCrLf + "Do you still want to proceed?", "Attention!!!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
open_connection1()
cmd.CommandText = "delete from tbl_attendance where F_date >= '" & txt_from.Text & "' and F_date <= '" & txt_to.Text & "'"
cmd.ExecuteNonQuery()
MessageBox.Show("Time table now is clear from " + txt_from.Text + " to " + txt_to.Text, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
cn.Close()
End If
End Sub
Error: "data type mismatch in criteria expression"
I am very frustrated with this error. please help