Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    492
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find Record (A2K2)

    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

  2. #2
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    492
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find Record (A2K2)

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •