Thanks for the help but the same error has come up. I have worked out it is to do with this line.

Code:
 cmd = New OleDbCommand("select * from Data where ID = txtPrimKey.Text", EMP)
If i put a number instead of the txtPrimKey.Text then it will work perfectly. I have also tried using

Code:
 cmd = New OleDbCommand("select * from MP where ID = PRIM", EMP)
but that still will not work.

If there any way of getting a the string PRIM to work.