Need help handling errors with this code. Any help is greatly appreciated.. This code searches and updates a field called Receipt# if the entered value is in the query it works fine if not the de###### opens and I get a runtime error 2427.. It highights the line MySet.FindFirst “[Receipt#] = ” & “‘” & Not sure what the problem is.. Is there a way to handle this error.. Thanks..
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim MyDB As DAO.Database
Dim MySet As DAO.Recordset
Set MyDB = CurrentDb()
‘Update this receipt number record
Set MySet = MyDB.OpenRecordset(“ReceiptNumbers”, dbOpenDynaset)
MySet.MoveFirst
MySet.FindFirst “[Receipt#] = ” & “‘” & Me.Text28 & “‘”
If MySet.NoMatch Then
MsgBox (“Receipt# ” & Me.Text28 & ” not found.”)
Else
MySet.Edit
MySet(“Group#”) = newSeqNo
MySet.Update
End If
MySet.Close
Set MySet = Nothing
Set MyDB = Nothing
End Sub