1 Replies - 613 Views - Last Post: 02 October 2012 - 01:13 PM Rate Topic: -----

#1 it1990  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 18-August 11

duplicate records

Posted 02 October 2012 - 07:10 AM

hi! thers always error when i add same id...please help me how to fix this..
tnx


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Then
        MsgBox "Please input the required data", vbExclamation
    Else
        MsgBox "Saved"
        End If
        
        
        With Adodc1.Recordset
            .AddNew
                .Fields("id").Value = Text1.Text
                .Fields("fname").Value = Text2.Text
                .Fields("mname").Value = Text3.Text
                .Fields("lname").Value = Text4.Text
                .Fields("bday").Value = Combo1.Text & " " & Combo2.Text & " " & Combo3.Text
                .Update
                Text1.Text = ""
                Text2.Text = ""
                Text3.Text = ""
                Text4.Text = ""
                
                End With





Is This A Good Question/Topic? 0
  • +

Replies To: duplicate records

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5480
  • View blog
  • Posts: 11,762
  • Joined: 02-June 10

Re: duplicate records

Posted 02 October 2012 - 01:13 PM

Are you really using ancient VB6?
Or is this really VB.net and needs to be moved?

Try to load the record of that name before you add it.
If you can load it, then it exists, so don't add it.
Kinda 'duh', don't you think?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1