• Find Record (A2K2)

    Author
    Topic
    #373040

    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

    Viewing 0 reply threads
    Author
    Replies
    • #598185

      Well, its working now with the same code.

      I don’t know if soemthing else was open, which was confusing it or whatever, but its working now.

      Colin

    Viewing 0 reply threads
    Reply To: Find Record (A2K2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: