Hi All, I have a problem I hope someone can help me with.
I have open a recordset of another table as below.
Dim rs1 AS DAO.Recordset
set rs1 = CurrentDb.OpenRecordset("SELECT * FROM AT_MI"
This table AT_MI has a field named NINO and I want to check for a duplicate.
Within the current form I have a a text box named ATfJ_NI that I want to check is in the AT_MI table within the NINO field so I do the following.
rs1.MoveLast
rs1.MoveFirst
str1 = "[NINO]=" Me![ATfJ_NI]
rs1.FindFirst str1
If rs1.NoMatch then
'Do some work'
When I test this it returns an error on the contents of the text box ATfj_NI "Does not recognize 'NW857395' as a valid field name or expression.
Can anyone help please?
Much Thanks
Paul Tiernan
I have open a recordset of another table as below.
Dim rs1 AS DAO.Recordset
set rs1 = CurrentDb.OpenRecordset("SELECT * FROM AT_MI"
This table AT_MI has a field named NINO and I want to check for a duplicate.
Within the current form I have a a text box named ATfJ_NI that I want to check is in the AT_MI table within the NINO field so I do the following.
rs1.MoveLast
rs1.MoveFirst
str1 = "[NINO]=" Me![ATfJ_NI]
rs1.FindFirst str1
If rs1.NoMatch then
'Do some work'
When I test this it returns an error on the contents of the text box ATfj_NI "Does not recognize 'NW857395' as a valid field name or expression.
Can anyone help please?
Much Thanks
Paul Tiernan