I’ve got a problem with a function that is crashing on me.
I have a click event on a button that starts a form to allow user input of the text I want to search for, and then starts the find record action.
Each time I run it I get
The Command or Action “Find Record” isn’t available now
I must be misisng something obvious, but can’t think what.
Any help would be greatly appreciated
Thanks
By the way, I can never get the syntax right, and I have tried it with “strFind” in the FindRecord line. This doesn’t work either
Private Sub btnFind_Click()
On Error GoTo Err_btnFind_Click
Dim strFind As String
Me.FilterOn = False ‘remove any filter settings
DoCmd.OpenForm “frmSearch”, acNormal, , , , acDialog ‘ Open search form
strFind = Forms!frmSearch.txtFind
DoCmd.Close acForm, “frmsearch”
JournalEntry.SetFocus
DoCmd.FindRecord strFind, acAnywhere, , acSearchAll, , acCurrent
Exit_btnFind_Click:
Exit Sub
Err_btnFind_Click:
MsgBox Err.Description
Resume Exit_btnFind_Click
End Sub