Okay, so it finds a match.
Now set the Bookmark of the form to the bookmark of the clone set:
Me.Bookmark = rs.Bookmark
That sets the current record of the form to the one found in the clone
set.
I am always going to the "match" part of the if statement no matter
what.
The field I want to check is geneticIDnumber in the DB to see if it =
RandomNum if it does they I want it to display "Match".
Do I have this setup right?
Me.geneticIDnumber = RandomNum
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[geneticIDnumber] = " & RandomNum
If rs.NoMatch Then
MsgBox "No match"
Else
MsgBox "match"
End If
:
Use FindFirst on the RecordsetClone of the form.
Test NoMatch, and set the form's Bookmark.
For an example, see:
Using a Combo Box to Find Records
at:
http://allenbrowne.com/ser-03.html
I need to know how to find a record using code? Basicly I want to
search a
field say GeneticIdNumber to see if the currentGeneticIdNumber is in
the
GeneticIdNumber field.