Within a single form I have used id and date as primary key, so while we are saving it onto a recordset, how can we check the duplicate entry?
[code=vb]
If rs.EOF Then
conn.Execute "insert into saldetail(id, date, othours, otamt, taxrate, netsal, province) values ('" & store & "','" & dtpay & "','" & txtoh & "','" & txtotamt & "','" & txttr & "','" & txtnsal & "','" & cbostate & "')"
MsgBox "INSERTED NEW RECORDS", vbOKOnly, "ADDING NEW RECORDS"
Else
'ID Found In DB (Duplicate)
MsgBox "Duplicate Entry"
End If
rs.Close
[/code]
I have to insert into this code???
Please guide me through.
[code=vb]
If rs.EOF Then
conn.Execute "insert into saldetail(id, date, othours, otamt, taxrate, netsal, province) values ('" & store & "','" & dtpay & "','" & txtoh & "','" & txtotamt & "','" & txttr & "','" & txtnsal & "','" & cbostate & "')"
MsgBox "INSERTED NEW RECORDS", vbOKOnly, "ADDING NEW RECORDS"
Else
'ID Found In DB (Duplicate)
MsgBox "Duplicate Entry"
End If
rs.Close
[/code]
I have to insert into this code???
Please guide me through.
Comment