Solved

Searching item in List Box with Ctrl F

Posted on 2004-04-18
3
605 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

831 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