Solved

Searching item in List Box with Ctrl F

Posted on 2004-04-18
3
600 Views
Last Modified: 2012-05-04
I have a list Box with some data .

When I press CTRL F to search something there ,all the time I receive a pop up "not find"

AND "Look in" field  is disabe. It's mean I can't put any column name there .Or sometime I receive
"You can't use find or replace dialog"

What I need to do to activate it ?
Thanks.
0
Comment
Question by:Irina_dusha
3 Comments
 
LVL 26

Expert Comment

by:Alan Warren
ID: 10852737
Hi Irina_dusha,

The FindRecord Action does not apply to listboxes, the listbox is not a searchable control.
You can find records in the active table datasheet, query datasheet, form datasheet, or form.

If you want to search a listbox you will need to loop through the ListItems collection of the control programatically. Basically means building your own search fuctionality.

Do you want more information how to do this?

Alan
0
 
LVL 7

Expert Comment

by:manthanein
ID: 10852854
I don't know if you can use this, intead of using CTRL-F, why not filter the listbox for the item you are trying to find..  you need to add a textbox and 2 command buttons  to the trick .

lstDesc  is a listbox
Description is a textbox
QueDeviceDesc is the underlying table
QueDeviceDesc.Description is the field shown in the listbox

then on the command Button_on click event add this code
lstDesc.RowSource = "SELECT * " & _
        "FROM QueDeviceDesc " & _
        "WHERE  QueDeviceDesc.Description like '*" & Description.Text & "*'"
lstDesc = Null

to show all the records.. delete all the characters in the textbox before hitting the command button

-------------------------
another solution without the button..
add the  same code in the textbox's keyup event, that way the list box will be filtered as you type characters or delete them
:)
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 125 total points
ID: 10853296
The easy way around this is to change the listbox into a datasheet subform.
By removing the navigation buttons and the Allow Update/Delete/Add set to NO it won't differ much and you're able to use the CTRL+F and even the right-click options to filter and sort.

Nic;o)
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now