Search Box on Continious form

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

Simon

I have a form that displays lots of data

I would like a text box at the top of the form that when i type in some
data it will filter every thing on that form if it contains when i type
in the box.

I will want it to search for it in 3 different fields if poss


Thanks

Simon
 
Thanks very much

Is there a way if i just type in 'Smi' it will find any names similare
to it like 'Smith'

Thanks
 
Use a "wildcard" in your criteria field

Like &"*"&[Forms]![DataEntryForm]![FieldOnForm]&"*"
 
I have my seach working fine now, I would it to every time i type in a
letter of a name it will requery and dispaly the best matches

I currently have the following code on the fied that i type in the
First name i would like to seach for

Private Sub FirstNameSearch_Change()
DoCmd.Requery
End Sub

the only problem is every time i type in the first letter i requrys it
but then it set the cursorto a differnet field therfor i can not carry
on typing in the name

is there a way to make sure it leaves the cursorin the same place after
i requry

Thanks


Use a "wildcard" in your criteria field

Like &"*"&[Forms]![DataEntryForm]![FieldOnForm]&"*"



Simon said:
Thanks very much
Is there a way if i just type in 'Smi' it will find any names similare
to it like 'Smith'
 
Simon,

Instead of putting the requery on the On Change event, put it on the After
Update event. That way, the requery will not run until you leave that field.
I would image you would not need to return to that field again when you
switch the code to the After Update but if by some chance you do, put the
following on the After Update

DoCmd.Requery
DoCmd.GotoControl "FirstNameSearch"

Hope this helps
Jackie


Simon said:
I have my seach working fine now, I would it to every time i type in a
letter of a name it will requery and dispaly the best matches

I currently have the following code on the fied that i type in the
First name i would like to seach for

Private Sub FirstNameSearch_Change()
DoCmd.Requery
End Sub

the only problem is every time i type in the first letter i requrys it
but then it set the cursorto a differnet field therfor i can not carry
on typing in the name

is there a way to make sure it leaves the cursorin the same place after
i requry

Thanks


Use a "wildcard" in your criteria field

Like &"*"&[Forms]![DataEntryForm]![FieldOnForm]&"*"



Simon said:
Thanks very much
Is there a way if i just type in 'Smi' it will find any names similare
to it like 'Smith'

You could create a query to use the three fields on your form as criteria,
base your form off the query and then either on a button or on the After
Update event of your fields, put:
DoCmd.Requery
Hope this helps.
Jackie
:
I have a form that displays lots of data
I would like a text box at the top of the form that when i type in some
data it will filter every thing on that form if it contains when i type
in the box.
I will want it to search for it in 3 different fields if poss

Simon- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -
 
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

Can some one help

thanks very much

Simon,

Instead of putting the requery on the On Change event, put it on the After
Update event. That way, the requery will not run until you leave that field.
I would image you would not need to return to that field again when you
switch the code to the After Update but if by some chance you do, put the
following on the After Update

DoCmd.Requery
DoCmd.GotoControl "FirstNameSearch"

Hope this helps
Jackie



Simon said:
I have my seach working fine now, I would it to every time i type in a
letter of a name it will requery and dispaly the best matches
I currently have the following code on the fied that i type in the
First name i would like to seach for
Private Sub FirstNameSearch_Change()
DoCmd.Requery
End Sub
the only problem is every time i type in the first letter i requrys it
but then it set the cursorto a differnet field therfor i can not carry
on typing in the name
is there a way to make sure it leaves the cursorin the same place after
i requry

Use a "wildcard" in your criteria field
Like &"*"&[Forms]![DataEntryForm]![FieldOnForm]&"*"
:
Thanks very much
Is there a way if i just type in 'Smi' it will find any names similare
to it like 'Smith'
Thanks
You could create a query to use the three fields on your form as criteria,
base your form off the query and then either on a button or on the After
Update event of your fields, put:
DoCmd.Requery
Hope this helps.
Jackie
:
I have a form that displays lots of data
I would like a text box at the top of the form that when i type in some
data it will filter every thing on that form if it contains when i type
in the box.
I will want it to search for it in 3 different fields if poss
Thanks
Simon- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -
 
Put the code

DoCmd.Requery
DoCmd.GoToControl "FirstNameSearch"

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

Can some one help

thanks very much

Simon,

Instead of putting the requery on the On Change event, put it on the After
Update event. That way, the requery will not run until you leave that field.
I would image you would not need to return to that field again when you
switch the code to the After Update but if by some chance you do, put the
following on the After Update

DoCmd.Requery
DoCmd.GotoControl "FirstNameSearch"

Hope this helps
Jackie



Simon said:
I have my seach working fine now, I would it to every time i type in a
letter of a name it will requery and dispaly the best matches
I currently have the following code on the fied that i type in the
First name i would like to seach for
Private Sub FirstNameSearch_Change()
DoCmd.Requery
End Sub
the only problem is every time i type in the first letter i requrys it
but then it set the cursorto a differnet field therfor i can not carry
on typing in the name
is there a way to make sure it leaves the cursorin the same place after
i requry

Use a "wildcard" in your criteria field
Like &"*"&[Forms]![DataEntryForm]![FieldOnForm]&"*"
:
Thanks very much
Is there a way if i just type in 'Smi' it will find any names similare
to it like 'Smith'

You could create a query to use the three fields on your form as criteria,
base your form off the query and then either on a button or on the After
Update event of your fields, put:
DoCmd.Requery
Hope this helps.
Jackie
:
I have a form that displays lots of data
I would like a text box at the top of the form that when i type in some
data it will filter every thing on that form if it contains when i type
in the box.
I will want it to search for it in 3 different fields if poss

Simon- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -
 
Pressing F2 works but is there a way to do it automatialy

Thanks

Put the code

DoCmd.Requery
DoCmd.GoToControl "FirstNameSearch"

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

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

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

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

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
Can some one help
thanks very much
Simon,
Instead of putting the requery on the On Change event, put it on the After
Update event. That way, the requery will not run until you leave that field.
I would image you would not need to return to that field again when you
switch the code to the After Update but if by some chance you do, put the
following on the After Update
DoCmd.Requery
DoCmd.GotoControl "FirstNameSearch"
Hope this helps
Jackie
:
I have my seach working fine now, I would it to every time i type in a
letter of a name it will requery and dispaly the best matches
I currently have the following code on the fied that i type in the
First name i would like to seach for
Private Sub FirstNameSearch_Change()
DoCmd.Requery
End Sub
the only problem is every time i type in the first letter i requrys it
but then it set the cursorto a differnet field therfor i can not carry
on typing in the name
is there a way to make sure it leaves the cursorin the same place after
i requry
Thanks
Use a "wildcard" in your criteria field
Like &"*"&[Forms]![DataEntryForm]![FieldOnForm]&"*"
:
Thanks very much
Is there a way if i just type in 'Smi' it will find any names similare
to it like 'Smith'
Thanks
You could create a query to use the three fields on your form as criteria,
base your form off the query and then either on a button or on the After
Update event of your fields, put:
DoCmd.Requery
Hope this helps.
Jackie
:
I have a form that displays lots of data
I would like a text box at the top of the form that when i type in some
data it will filter every thing on that form if it contains when i type
in the box.
I will want it to search for it in 3 different fields if poss
Thanks
Simon- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -
 

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