Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 626
  • Last Modified:

Searching item in List Box with Ctrl F

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
Irina_dusha
Asked:
Irina_dusha
1 Solution
 
Alan WarrenCommented:
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
 
manthaneinCommented:
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
 
nico5038Commented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now