468,537 Members | 2,442 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,537 developers. It's quick & easy.

immediate filtering

Hi,

I would like that my subform is immediately filtered as soon as one types a
letter in an unbound searchbox in the form.
If one types an 's' the content of the subform shows only records starting
with s
If one continues with 'e' the subform would show the ones starting with se.
If one would correct that to 'e' by going back and removing the 's' the
records would start with an e.

Any suggestions?

Thanks in advance

Michiel

Jun 27 '08 #1
8 1144
On Thu, 24 Apr 2008 20:20:11 GMT, "Michiel Rapati-Kekkonen"
<nn@nonsense.zzwrote:

Write your code in the <control>_Change event.
-Tom.

>Hi,

I would like that my subform is immediately filtered as soon as one types a
letter in an unbound searchbox in the form.
If one types an 's' the content of the subform shows only records starting
with s
If one continues with 'e' the subform would show the ones starting with se.
If one would correct that to 'e' by going back and removing the 's' the
records would start with an e.

Any suggestions?

Thanks in advance

Michiel
Jun 27 '08 #2
great
and thank you
(Dank je)

Michiel
"Tom van Stiphout" <no*************@cox.netwrote in message
news:ra********************************@4ax.com...
On Thu, 24 Apr 2008 20:20:11 GMT, "Michiel Rapati-Kekkonen"
<nn@nonsense.zzwrote:

Write your code in the <control>_Change event.
-Tom.

>>Hi,

I would like that my subform is immediately filtered as soon as one types
a
letter in an unbound searchbox in the form.
If one types an 's' the content of the subform shows only records starting
with s
If one continues with 'e' the subform would show the ones starting with
se.
If one would correct that to 'e' by going back and removing the 's' the
records would start with an e.

Any suggestions?

Thanks in advance

Michiel
Jun 27 '08 #3
butbut, how do I know what is in the box?
at the moment of the Change event the content of the control is not yet
recognized.
Or I donot know how to get it from it...

Michiel

"Tom van Stiphout" <no*************@cox.netwrote in message
news:ra********************************@4ax.com...
On Thu, 24 Apr 2008 20:20:11 GMT, "Michiel Rapati-Kekkonen"
<nn@nonsense.zzwrote:

Write your code in the <control>_Change event.
-Tom.

>>Hi,

I would like that my subform is immediately filtered as soon as one types
a
letter in an unbound searchbox in the form.
If one types an 's' the content of the subform shows only records starting
with s
If one continues with 'e' the subform would show the ones starting with
se.
If one would correct that to 'e' by going back and removing the 's' the
records would start with an e.

Any suggestions?

Thanks in advance

Michiel
Jun 27 '08 #4

"Michiel Rapati-Kekkonen" <nn@nonsense.zzwrote in message
news:%X**************@read4.inet.fi...
Hi,

I would like that my subform is immediately filtered as soon as one types
a letter in an unbound searchbox in the form.
If one types an 's' the content of the subform shows only records starting
with s
If one continues with 'e' the subform would show the ones starting with
se.
If one would correct that to 'e' by going back and removing the 's' the
records would start with an e.

Any suggestions?

Thanks in advance
What you describe is the way that Combo Boxes work with their AutoExpand
property set to Yes (the default setting). If you would clarify what you
are attempting to accomplish, rather than how you intended to accomplish it,
perhaps someone could make a useful suggestion. Perhaps you might even use
a Combo Box, instead of a continuous forms view Form embedded in a Subform,
to perform the function you want.

Tom is correct... I am certain you can, with expenditure of time and effort,
re-implement the AutoExpand functionality for your Subform (the examples of
which I have read did so for a List Box, though I cannot imagine why they
did not use a Combo Box instead).

If you cannot get at the current content, what VBA code are you using? The
complete contents of that text box should be available in the OnChange event
should be available as its Text property -- determining whether an
additional letter has been added, or a backspace deleted one, or the
contents cleared are what will make this more of a challenge than just using
a ComboBox, which has the added benefit of preventing you from going afar
off typing several letters of a non-existent term.

Larry Linson
Microsoft Office Access MVP

Larry Linson
Microsoft Office Access MVP
Jun 27 '08 #5

On Sun, 27 Apr 2008 09:23:48 GMT, "Michiel Rapati-Kekkonen" <nn@nonsense.zz>
wrote:
>butbut, how do I know what is in the box?
at the moment of the Change event the content of the control is not yet
recognized.
Or I donot know how to get it from it...

Michiel

Read the "Text" property of the control. It returns the current displayed
content of the control not the stored value.

strSearch = Me.MyCombo.Text
Wayne Gillespie
Gosford NSW Australia
Jun 27 '08 #6
Thank you
indeed I never used that property before!
Good to know, very good to know.

Michiel

"Wayne Gillespie" <be*****@NOhotmailSPAM.com.auwrote in message
news:rn********************************@4ax.com...
>
On Sun, 27 Apr 2008 09:23:48 GMT, "Michiel Rapati-Kekkonen"
<nn@nonsense.zz>
wrote:
>>butbut, how do I know what is in the box?
at the moment of the Change event the content of the control is not yet
recognized.
Or I donot know how to get it from it...

Michiel


Read the "Text" property of the control. It returns the current displayed
content of the control not the stored value.

strSearch = Me.MyCombo.Text
Wayne Gillespie
Gosford NSW Australia
Jun 27 '08 #7
Thanks for your extensive response,
but it was the Text property, I did not know about.
Now I know, and now it works the way I want it.

Thank you

Michiel
"Larry Linson" <bo*****@localhost.notwrote in message
news:IE3Rj.2321$Rk6.2285@trnddc07...
>
"Michiel Rapati-Kekkonen" <nn@nonsense.zzwrote in message
news:%X**************@read4.inet.fi...
>Hi,

I would like that my subform is immediately filtered as soon as one types
a letter in an unbound searchbox in the form.
If one types an 's' the content of the subform shows only records
starting with s
If one continues with 'e' the subform would show the ones starting with
se.
If one would correct that to 'e' by going back and removing the 's' the
records would start with an e.

Any suggestions?

Thanks in advance

What you describe is the way that Combo Boxes work with their AutoExpand
property set to Yes (the default setting). If you would clarify what you
are attempting to accomplish, rather than how you intended to accomplish
it, perhaps someone could make a useful suggestion. Perhaps you might
even use a Combo Box, instead of a continuous forms view Form embedded in
a Subform, to perform the function you want.

Tom is correct... I am certain you can, with expenditure of time and
effort, re-implement the AutoExpand functionality for your Subform (the
examples of which I have read did so for a List Box, though I cannot
imagine why they did not use a Combo Box instead).

If you cannot get at the current content, what VBA code are you using?
The complete contents of that text box should be available in the OnChange
event should be available as its Text property -- determining whether an
additional letter has been added, or a backspace deleted one, or the
contents cleared are what will make this more of a challenge than just
using a ComboBox, which has the added benefit of preventing you from going
afar off typing several letters of a non-existent term.

Larry Linson
Microsoft Office Access MVP

Larry Linson
Microsoft Office Access MVP

Jun 27 '08 #8

"Michiel Rapati-Kekkonen" <nn@nonsense.zzwrote
Thanks for your extensive response,
but it was the Text property, I did not know about.
Now I know, and now it works the way I want it.
Content is available in the .Text property or the .Value property (the
latter is the default property of a Control). It can be an interesting read
to learn the differences, but in the long run, may just be easier to try
..Value (or nothing, using the default to .Value) and then try .Text when
that doesn't do what you want.

Larry Linson
Microsoft Office Access MVP
Jun 27 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jon Davis | last post: by
3 posts views Thread by Russell Stevens | last post: by
2 posts views Thread by JUAN ERNESTO FLORES BELTRAN | last post: by
5 posts views Thread by vul | last post: by
2 posts views Thread by dgk | last post: by
6 posts views Thread by Frank Rizzo | last post: by
3 posts views Thread by Rahul Babbar | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.