Search form

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

I would like the qurey to run every time i type in a new letter.

for example if i have the following names in the databse


Alex
Andy
Caroline
Catherine
Chris
Dan


the the above name are displayed in a continuous form but when i type
'C' into the search box it requerys and displays


Caroline
Catherine
Chris


then i would be able to type another letter in the search box 'Ca' into

the search box it requerys and displays


Caroline
Catherine


hen i would be able to type another letter in the search box 'Car' into

the search box it requerys and displays


Caroline


There for the the only person in the databse with 'Car' in there name
is Caroline


There for i would like to be able to type in a letter then it requersy
.. I do not want to type in the name then when i leave the box it querys

it

The code i currentlt have is
Private Sub FirstNameSearch_Change()
DoCmd.Requery
DoCmd.GoToControl "FirstNameSearch"
End Sub

this sort of works but every time i type in a letter it writes over the
letter that is currenrly in the search field



Can some one help


thanks very much
 
Try:

Private Sub FirstNameSearch_Change()
Me.Requery
Me!FirstNameSearch.SetFocus
Me!FirstNameSearch.SelStart = Len(Me!FirstNameSearch)
End Sub
 
Thanks very much, its does what i want

Only problem is that if i type in a name then delete the name i get the
following error

Run time error 13
Type Missmatch
END DEBUG

Is there a way how to stop this error

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top