Hello every one.
i am trying to catch duplicate values from a data. in the picture when i want to add new record, then if the record already exists then go to that record and fill all the boxes, then i will press the update button,but if not, then add new value. field is indexed.
Capture.JPG![Capture.JPG]
so how to code that? i need it very much.
here is the code:
[IMGNOTHUMB]https://bytes.com/attachments/attachment/8525d1447076834/capture.jpg[/IMGNOTHUMB]
i am trying to catch duplicate values from a data. in the picture when i want to add new record, then if the record already exists then go to that record and fill all the boxes, then i will press the update button,but if not, then add new value. field is indexed.
Capture.JPG![Capture.JPG]
so how to code that? i need it very much.
here is the code:
Code:
Private Sub cmdAdd_Click()
If T6.Text = Data.Recordset.Fields("Name").Value Then
T8.Text = Data.Recordset.Fields("Amount").Value
T9.Text = Data.Recordset.Fields("Price").Value
T10.Text = Data.Recordset.Fields("Bought").Value
T11.Text = Data.Recordset.Fields("Date").Value
Else
MsgBox ("new record")
' what i need here to insert? to add a new record
End Sub
Comment