G
Guest
I am trying to check to see if this record already exists in a table. This
function (doesMemberExist) keeps returing null. I think I know the problem
but I don't really know how to fix it partially because I don't understand
how this function works. The table's primary key is made up of the
combination of 2 fields. The form the parent contains the first field in the
key and its subform contains the second.
membersCheck = "Select * FROM [myTable]"
If Not DoesMemberExist(recordCheck) Then
.....
End If
Public Function DoesMemberExist(sSource) As Boolean
'Checks to see if the members that are contained in the 'sSource'
'are inserted or if they are null
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset(sSource)
DoesMemberExist = Not rst.EOF
rst.Close
db.Close
Set rst = Nothing
Set db = Nothing
Exit Function
End Function
How can I change this function to allow it to work and if thats not the
problem any suggestions?
function (doesMemberExist) keeps returing null. I think I know the problem
but I don't really know how to fix it partially because I don't understand
how this function works. The table's primary key is made up of the
combination of 2 fields. The form the parent contains the first field in the
key and its subform contains the second.
membersCheck = "Select * FROM [myTable]"
If Not DoesMemberExist(recordCheck) Then
.....
End If
Public Function DoesMemberExist(sSource) As Boolean
'Checks to see if the members that are contained in the 'sSource'
'are inserted or if they are null
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset(sSource)
DoesMemberExist = Not rst.EOF
rst.Close
db.Close
Set rst = Nothing
Set db = Nothing
Exit Function
End Function
How can I change this function to allow it to work and if thats not the
problem any suggestions?