Hey Guys,
I have a form where im fillind data into boxes and then i have "add record" button which is sending the data to a table.The code is like this:
Private Sub addrecord_Click()
CurrentDb.Execute "INSERT INTO tablename(a1,a2,a3,a4,a5,a6)" & _
"VALUES('" & b1 & "','" & b2 & "','" & b3 & "','" & b4 & "','" & b5 & "','" & b6 & "')"
End Sub
My quation is: How can i say if the values in B1 and B2 already exist in the table into a1 and a2, to do not add new record?
ans also
How ot make a button, if the data in B1 and B2 already exist in A1 and A2, to find it and then to show the rest data in b3, b4, b5 and b6 to be able for edit?
Gr
I have a form where im fillind data into boxes and then i have "add record" button which is sending the data to a table.The code is like this:
Private Sub addrecord_Click()
CurrentDb.Execute "INSERT INTO tablename(a1,a2,a3,a4,a5,a6)" & _
"VALUES('" & b1 & "','" & b2 & "','" & b3 & "','" & b4 & "','" & b5 & "','" & b6 & "')"
End Sub
My quation is: How can i say if the values in B1 and B2 already exist in the table into a1 and a2, to do not add new record?
ans also
How ot make a button, if the data in B1 and B2 already exist in A1 and A2, to find it and then to show the rest data in b3, b4, b5 and b6 to be able for edit?
Gr