Make your recordset look for the ONE record with that serial #.
(I'm assuming you've guarded against duplicate serial #'s in this database and [Serial #] is text.)
Like this:
Code:
Private Sub UF_Next_Click()
Dim TblCalRec As Recordset
Dim Cdb As Database
Dim sql as String
sql = "Select CalRecord.* from CalRecord where CalRecord.[Serial #] = '" & UCase(Uf_SerN) & "';"
Set Cdb = CurrentDb
Set TblCalRec = Cdb.OpenRecordset(sql)
With TblCalRec
If .Recordcount = 0 then
.AddNew
![Serial #]
.Update
Else
msgBox "Found"
End If
End With
End Sub
Hope this helps!
Laurel
Last edited by Laurel; 01-30-2006 at 02:53 PM.
A balanced diet is a cookie in each hand.
Bookmarks