Compiler complaining that the DCount statment is invalid, requiring a "(". Seems that the problem is somehow more basic with regards to the syntax, but I haven't found it. I've tried "[NameExp] = """ & strComp & """" as the criteria, but that doesn't work either. What am I missing here?
Code:
Public Sub LoadtblGFM()
Dim rsSav As DAO.Recordset
Dim strSplit() As String
Dim strFName As String
Dim strLName As String
Dim strComp As String
strSplit = Split(strLine, " ")
strLName = strSplit(UBound(strSplit))
strFName = Left(strLine, Len(strLine) - Len(strLName))
strComp = strLName & "," & strFName
Set rsSav = DBEngine(0)(0).OpenRecordset("QGFM")
rsSav.AddNew
rsSav!LastName = strLName
rsSav!Firstname = strFName
rsSav!Donation = stramount
If DCount("[NameExp]", "QADFnames", "[NameExp] = " & strComp) > 0 Then _
rsSav!FLMember = True
rsSav.Update
rsSav.Close
Set rsSav = Nothing
End Sub