Repalcement For Find In Newer Versions Of Access

I developed an application in Access 2003 for a client many years ago.  I used a 'Find/Binocular' button on the form which had this code behind it.

    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Open in new window


It is the generic 'Find' with the binoculars showing.

Six months ago the client upgrade to Access 2010 with no changes to the MDB and the command button has continued to work.

I recently updated the MDB on a machine running Access 2010.  I didn't make any changes to the form the 'Find' command is on and I left the app as an MDB.

Now the Find/Binocular button doesn't work.

I know that the format of the find is not supported anymore but it worked running in Access 2010 until I made non (Find) related revisions to the app.

Is there a reference I can add to get the find to work?  If not, what command replaces the find command I am using in newer versions of Access?
LVL 1
mlcktmguyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

aikimarkCommented:
application.RunCommand acCmdFind

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlcktmguyAuthor Commented:
Thank you, I made the chnange  but I am getting runtime error '2046' The command or action Find isn't available now when I press the button.

Here is the code in my module:
'
    If Me.Dirty Then
      response = MsgBox("You have made changes to this record." & Chr(10) & Chr(13) & "Save these changes?", vbOKCancel)
      If response <> 1 Then
         Me.Undo
         GoTo FindIt99
      End If
'
      Any_Edit_Errors = True
'
      Edit_Record
'
      If Any_Edit_Errors = True Then
          Exit Sub
      End If
'
      AlreadyUpdated = True
'
    End If
'
FindIt99:

    Screen.PreviousControl.SetFocus
    DoCmd.RunCommand acCmdFind
'
End Sub

Open in new window

Then Access is completely locked up.  I can't close the form using my user defined 'Exit' button or the 'X' in the upper right hand corner of the form.
I can't close Access using the 'X' in the upper right hand corner of Access.  I have to use the task manager to cancel Access.
I get no messages but nothing will close.

I also tried building  the button using the wizard, which resulted in this code.
Private Sub btnSysytemFind_Click()
On Error GoTo Err_btnSysytemFind_Click


    Screen.PreviousControl.SetFocus
    DoCmd.RunCommand acCmdFind

Exit_btnSysytemFind_Click:
    Exit Sub

Err_btnSysytemFind_Click:
    MsgBox Err.Description
    Resume Exit_btnSysytemFind_Click
    
End Sub

Open in new window


Since there is an error handler I get the same message ' The command or action Find isn't available now' in a message box but the application doesn't lock up.

Either way the Find isn't working.
0
mlcktmguyAuthor Commented:
This is the correct command.  The issue was being caused because I was opening the form with acDialog specified
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

aikimarkCommented:
Ah. I see.  I wouldn't have guessed that this code was inside a modal/dialog instance of the form.
0
mlcktmguyAuthor Commented:
Strangely that had been the same and worked perfectly for many years.  It was only when I worked on this form in Access 2007 instead of Access 2003 that this problem came up. I even kept the application as an MDB.
0
aikimarkCommented:
I've encountered similar differences in applications run 2007+ versions of Access that worked just fine in 2003.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.