Hi
I need some help with finding a record in a recordset. I don't want a recordset of the found data returned, all I want to know is if it is present or not. Basically I have a recordset rsX containing details of a medical practice including a field containing the id of the senior GP (GP_id) for that practice. What I want to do is check that that GP is in listed in another recordset rsY which lists all GPs (by GP_id)associated with the practice i.e. a GP can't be the senior GP if they are not a member of the practice.
I've been using recordset.Find() but with little success
Dim id As String
id = rsX!GP_id
check = rsY.Find("GP_id = '" & id & "'", , adSearchForward)
If check = -1 Then
MsgBox ("This GP is not listed as a member of the practice"
End If
Any ideas?
I need some help with finding a record in a recordset. I don't want a recordset of the found data returned, all I want to know is if it is present or not. Basically I have a recordset rsX containing details of a medical practice including a field containing the id of the senior GP (GP_id) for that practice. What I want to do is check that that GP is in listed in another recordset rsY which lists all GPs (by GP_id)associated with the practice i.e. a GP can't be the senior GP if they are not a member of the practice.
I've been using recordset.Find() but with little success
Dim id As String
id = rsX!GP_id
check = rsY.Find("GP_id = '" & id & "'", , adSearchForward)
If check = -1 Then
MsgBox ("This GP is not listed as a member of the practice"
End If
Any ideas?