Hi,
I am trying to test a recordset for the NoMatch and pop up a message box if there is no match. But rst.NoMatch always equal False even when there is no match?? Code below...
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("SELECT longProjectName FROM Project WHERE projectName= '" & globalResort & "';"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
If rst.NoMatch = True Then
Dim retValue
retValue = MsgBox("Contact the administrator.", vbExclamation, "Out of Records"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Else
comboResort.value = rst![longProjectName]
End If
rst.Close
Set rst = Nothing
Set db = Nothing
Thanks
eclipse33![[reading] [reading] [reading]](/data/assets/smilies/reading.gif)
I am trying to test a recordset for the NoMatch and pop up a message box if there is no match. But rst.NoMatch always equal False even when there is no match?? Code below...
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("SELECT longProjectName FROM Project WHERE projectName= '" & globalResort & "';"
If rst.NoMatch = True Then
Dim retValue
retValue = MsgBox("Contact the administrator.", vbExclamation, "Out of Records"
Else
comboResort.value = rst![longProjectName]
End If
rst.Close
Set rst = Nothing
Set db = Nothing
Thanks
eclipse33
![[reading] [reading] [reading]](/data/assets/smilies/reading.gif)