By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,919 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,919 IT Pros & Developers. It's quick & easy.

Filter by selection in code

P: n/a
When looking at a table etc, you can highlight a few characters in a field
and click the Filter by Selection button and the table is filtered by these
characters.

Can you mimic this process in code? I need for users to be able to highlight
a few characters in a form data sheet and then click a button to check a box
on what would be the filter results ( I don't need it to filter the records,
just check those that match.)

So if you have

James
Jones
Johnson

and the user highights Jo and clicks a button, he gets

James
Jones x
Johnson x

Using A2000

Oct 28 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Karl Irvin wrote:
Can you mimic this process in code? I need for users to be able to highlight
a few characters in a form data sheet and then click a button to check a box
on what would be the filter results
Not by clicking a button on the form because as soon as the text box loses
focus the selected text in the text box is no longer selected. You can use
the text box's mouse up event like this:

Dim sFilter As String

sFilter = Me!txtLastName.SelText
Me!lstList.RowSource = "SELECT LastName FROM qryEmps WHERE LastName LIKE
'" & sFilter & "*'"
Me!lstList.Requery

The results would show up in the list box, lstList.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200610/1

Oct 29 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.