I'll try to make this concise. Anyways, I'm trying to only allow unique data to my database. my database. What I did before adding the entry is to use a Search Query for the value of the txtbox
"SELECT IDnum WHERE IDnum = '" & txtID & "'"
Then compare it with that of the txtbox.
IF objReader("IDNum") <> txtID.textbox then add the entry Else Display a Warning.
in the above code, I can detect the when the user entered an existing value. however, If the user entered a NEW (unique) value an error is Raised "Invalid attempt to read when no data is present" I hit the wall with this.
So what I did, Since I can detect Duplicates and have errors when entering unique value, I used the ON ERROR GOTO statement: I did it like this.
On Error Goto errHandler
If objReader("IDNum") = txtID.textbox then
lbl1.text = "Existing Record"
'do the codes to add the entry
View Complete Post