Please correct the syntax of the rs.findfirst line in the code below. I'm fairly sure I've got the inverted comma's all wrong.
Code:
Public Sub inDB(str As String)
Dim db As Database
Dim rs As Recordset
Dim frm As Form
Dim str2 As String
Set frm = Screen.ActiveForm
Set db = CurrentDb
str2 = frm.Genus
Set rs = db.OpenRecordset("main", dbOpenSnapshot)
rs.MoveFirst
rs.FindFirst "Accessionnumber ='" & str & "'" & "Genus='" & str2 & "'"
If rs.EOF Then
frm.txtmain.BackColor = RGB(200, 0, 0)
Else
frm.txtmain.BackColor = RGB(0, 200, 0)
End If
rs.Close
End Sub[
/CODE]