Solved

Searching item in List Box with Ctrl F

Posted on 2004-04-18
3
607 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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.

752 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