Results 1 to 2 of 2

Thread: Stop Duplicate

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2011
    Posts
    21

    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

  2. #2
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Smile 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 & "')"
    Last edited by firoz.raj; Oct 20th, 2011 at 12:59 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width