Problem with Multi Search Form

bigalpha

Registered User.
Local time
Yesterday, 19:42
Joined
Jun 22, 2012
Messages
415
I'm using this search form.

I have never had issues with it until today. When I type the letter "i" as the first letter in the 'Search For' box, I get the following error:

"Microsoft Office Access can't move the focus to the control SearchResults"

Also, when I type "i", it shows up in the box as "I" and is the only letter that does this.

I don't know why.
 
I can replicate what you describe.

I first thought it might have been auto correct, causing the letter to capitalise and triggering a second call to the procedure.

I don't have any explanation to offer as to the behaviour.

A work around would be to add the following line, before the line where the code stops, Me.SearchResults.SetFocus

On error resume next
 
This is such a odd little bug that I actually remembered coming across it before, here or elsewhere, and created a file documenting the solution. Assuming that the Control you're entering your search term into is named SearchFor, as it is in the sample file you're using, add this bit of code to the code module behind the search form:

Code:
Private Sub SearchFor_Keypress(KeyAscii As Integer)
 KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub

It will capitalize everything typed into the search field, but will solve the problem of the initial 'i', at least it did in the copy of the file I downloaded.

Linq ;0)>
 
Thanks for the assistance, I'll be sure to implement the fix. I thought I was going crazy at first!
 
As I said, it is an odd bug, even for Access, which is why I remembered it! The amazing thing was that I found it, out of my 3400 'help files!'

Linq ;0)>
 
Wow, that's quite a collection of help files! Have you considered zipping them and posting them all?
 

Users who are viewing this thread

Back
Top Bottom