Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / December 2005

Tip: Looking for answers? Try searching our database.

Continuous filtering of a listbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alp Bekisoglu - 07 Dec 2005 22:33 GMT
Hi Experts,

Need to create a form (maybe with a sub-form) to do the following:
As the user types a company name the listbox below this textbox should
update and show matching records from the company table.

So far I have a query, a form based on this query and another form with an
unbound textbox as the input location. This form also has the query based
form as its sub. The query refers to the unbound textbox as its parameter.
SQL behind the query is:
SELECT co_main.co_id, co_main.co_adi
FROM co_main
WHERE (((co_main.co_adi) Like [Forms]![Form1]![Text0] & "*"));

Behind the mother form I have:
With Me.fr_qry_co_main_ara '.Properties
   .Requery
   .Visible = True
End With

I placed this code under BeforeUpdate, AfterUpdate, Change, and even
KeyPress but it does not do what I intend to do. It works as it is now if I
hit enter after each letter but that is not the goal.

I know this can be achieved but just couldn't find out how to.

Thanks in advance for any help or guidance.

Alp
MacDermott - 08 Dec 2005 00:57 GMT
You could try this in the textbox's Change event procedure:
   Me.fr_qry_co_main_ara.RowSource="SELECT co_main.co_id, co_main.co_adi
FROM co_main WHERE (((co_main.co_adi) Like '" & [Forms]![Form1]![Text0].Text
& "*'));"

HTH

> Hi Experts,
>
[quoted text clipped - 25 lines]
>
> Alp
Alp Bekisoglu - 08 Dec 2005 10:59 GMT
Thanks for the suggestion but I'm getting "Method or Data Member not found"
error when I use it.

Alp

> You could try this in the textbox's Change event procedure:
>    Me.fr_qry_co_main_ara.RowSource="SELECT co_main.co_id, co_main.co_adi
[quoted text clipped - 36 lines]
>>
>> Alp
MacDermott - 08 Dec 2005 13:51 GMT
fr_qry_co_main_ara is the name of your listbox, right?

> Thanks for the suggestion but I'm getting "Method or Data Member not found"
> error when I use it.
[quoted text clipped - 41 lines]
> >>
> >> Alp
Alp Bekisoglu - 08 Dec 2005 14:18 GMT
No, sorry I did not mention which is which. fr_qry_co_main_ara is the name
of the subform based on the mentioned query.

Alp

> fr_qry_co_main_ara is the name of your listbox, right?
>
[quoted text clipped - 48 lines]
>> >>
>> >> Alp
MacDermott - 09 Dec 2005 01:27 GMT
I don't think you even mentioned having a subform.
Of course it's the listbox whose RowSource property you'll be updating.
Use its name in the code I suggested.

Or perhaps you should just be using a combobox instead of a textbox and
listbox?

> No, sorry I did not mention which is which. fr_qry_co_main_ara is the name
> of the subform based on the mentioned query.
[quoted text clipped - 53 lines]
> >> >>
> >> >> Alp
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.