-
Stop Duplicate
Hi Pals. I've been struggling how to stop inserted duplicate records. This is the scenario.At form load,it automatically insert records of employee (this is an attendance monitoring system) and just updates each record at punch in.my problem is when i unload the form and load it again,obviously there are duplicated records with the same date.how can i solve that? nevermind the other bugs if there is so.just solve what i ask.tnx
this my code:
rs.Open "select * from emp ", con
Do While Not rs.EOF
id = rs!id
con.Execute "insert into attendance (id,dets)values('" & id & "')"
rs.MoveNext
Loop
rs.Close
-
Re: Stop Duplicate
how you are loading your data ? .it is from text box .just filter in your sql statement .something like where emp_id=txtempid.text .so you will get only those records.or better zip the specific form .and upload it here .so that we will guide you properly.:)
and additional your insert statement is wrong .where is date variable in values clause ?.
con.Execute "insert into attendance (id,dets)values('" & id & "')"