[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 502
  • Last Modified:

Control can't be searched

I am using a 'Find' pop-up same is in Word, Excel etc. When I write the search word and press 'Find', I get:

"The control 'Command66' the macro is attempting to search can't be searched."

Here's part of the code running behind the form:

Private Sub Command66_Click()
On Error GoTo Err_Command66_Click


    Screen.PreviousControl.SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Command66_Click:
    Exit Sub

Err_Command66_Click:
    MsgBox Err.Description
    Resume Exit_Command66_Click
   
End Sub
0
muhammasif
Asked:
muhammasif
1 Solution
 
ArjiCommented:
I think you are focused on a Button control.  ctrl-F can't search a Button. Hit the tab key or click on a text field before ctrl-F.
0
 
kirenievsCommented:
May be you could replace
Screen.PreviousControl.SetFocus

with
Me!TheNameOfYourControl.SetFocus

/Svein Erik
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now