|
-
Apr 7th, 2007, 05:38 PM
#1
Thread Starter
New Member
hinder same data?
hi everyone,my question is about entering same data to database,i want to hinder i wrote code below,but when i enter same data or new data ,it records ,how can i control to hinder same data?
--------------
cmd_new_click()
rs.addnew
end sub
cmd_save_click()
rs.MoveFirst
Do While Not rs.EOF
If rs.RecordCount <> 0 Then
If Text1.Text = rs.Fields("NAME").Value Then
MsgBox "this name is recorded,enter new name"
rs.CancelBatch
Exit Sub
else
rs!NAME = Text1.Text
--
--
--
rs.UpdateBatch
End If
End If
rs.MoveNext
Loop
end sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|