Hi,
I'm relatively new to writing Access modules so please bear with me
I'm using Access 2003 and developing a module to pull data from a table, manipulate it, then use it to populate an external config file for some SCADA software. Essentially, everything works fine barring the part that has to search the table for a string.
I am using a DAO recordset, and I am using all other recordset methods without a problem (which leads me to believe that everything is fine, barring my syntax when using the FindFirst method). The problem is that it seems to find no records with the matching criteria, despite the fact that they are there. I am checking this with the .NoMatch property which always equates to be true after the findfirst method.
Thanks in advance to anyone that can help
Here is snippet of the code. There are a few commented lines which show my attempts at using FindFirst unsuccessfully. (
If it would make it easier for anyone to help, I can post the full module
)
I'm relatively new to writing Access modules so please bear with me

I'm using Access 2003 and developing a module to pull data from a table, manipulate it, then use it to populate an external config file for some SCADA software. Essentially, everything works fine barring the part that has to search the table for a string.
I am using a DAO recordset, and I am using all other recordset methods without a problem (which leads me to believe that everything is fine, barring my syntax when using the FindFirst method). The problem is that it seems to find no records with the matching criteria, despite the fact that they are there. I am checking this with the .NoMatch property which always equates to be true after the findfirst method.
Thanks in advance to anyone that can help

Here is snippet of the code. There are a few commented lines which show my attempts at using FindFirst unsuccessfully. (
If it would make it easier for anyone to help, I can post the full module

Code:
'Search all recordsets for the Memory Word in which the bit is mapped *from*
' Dim criteria As String
' criteria = ".Fields(""PROC Reg/Tag"") = " & registerANA
' criteria = "PROC Reg/Tag = '" & registerANA & "'"
' .FindFirst (criteria)
.FindLast (.Fields("PROC Reg/Tag") = registerANA)
'If a record is found
If recordset.NoMatch = False Then
'If the record is that of an Analogue tag
If recordset.Fields("Data Type") = "ANA" Then
'Is the field blank?
blankTag2 = IsNull(recordset.Fields("Data Tag*"))
If blankTag2 = False Then
word = recordset.Fields("Data Tag*")
Else
word = ""
End If
End If
'Move record pointer back to the earlier set bookmark
recordset.Bookmark = BM
Else
'No Match Found
word = ""
'Move record pointer back to the earlier set bookmark
recordset.Bookmark = BM
End If