Unanswered: How to check if there is aleady a record??
I wanna know the line of codes...
I have a program that can be registered via handphone. But now the problem is, if the person's number is already in the database, I do want his/her record to be duplicated. Hmm, so may i know the line of codes please so that it won't be inserted again into the database if there is already his/her handphone number inside..
I take the "handphone" means cellphone/mobile phone.
You have two options;
make the column which contains the cellphone number unique so the DBMS will not allow a duplicate record (hint: add a constraint),
check before inserting the record into the table; e.g.
rs.source="select count(*) as x from x where cellnumber=" & cdbl(cellnumber)
if rs.fields("x")>0 then
'there is already a record, this would be a dupe
'insert the record it doesn't exist.