listbox not working (1 Viewer)

FLIPPIE

New member
Local time
Today, 16:35
Joined
Apr 8, 2020
Messages
4
ACCESS 2007


A-B-C-D
A-D-F-R
S-B-R-F
S-E-D-R
S-L-R-F

WITH EACH LETTER A DIFFERENT FIELD

WHEN I ASK THE LIST BOX TO LOOK FOR RECORD S-L-R-F, THE SEARCH STOPS AT S-B-R-F, AND THIS RECORD IS SHOWN IN FORM, NOT THE REQUESTED S-L-R-F.
SO IT STOPS AT THE FIRST LETTER FROM THE SEARCH
 

Ranman256

Well-known member
Local time
Today, 11:35
Joined
Apr 9, 2015
Messages
4,337
Does the query ask for all records?
How does it 'search'?
Normally you pick from the list. The list should have 2 fields: the key,and the all fields that you show.
When user picks the item,it should have the value of the key.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 16:35
Joined
Feb 19, 2013
Messages
16,607
I suspect you are talking about the search by typing a character in the listbox - for a listbox that only works for the first character. For a combo, it will continue searching on the subsequent characters.
 

jdraw

Super Moderator
Staff member
Local time
Today, 11:35
Joined
Jan 23, 2006
Messages
15,379
I suggest you copy the actual code for the search and show us the form and listbox involved.
Readers need more info to offer more focused responses.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:35
Joined
May 7, 2009
Messages
19,237
as you have said on post #1, each letter comes from 4 diff fields so you also seach the four fields for the value of the combo.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 11:35
Joined
May 21, 2018
Messages
8,527
WITH EACH LETTER A DIFFERENT FIELD
If each letter is in a different field you need first to concatenate the fields into a single field. Then you need a find as you type, because I think it will still stop on the first "S". See the find as you type listbox example, or the Search as you type.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:35
Joined
Oct 29, 2018
Messages
21,468
Hi. Try adding a hidden column with unique values (like an ID field) to your list and then bind your list to that column.
 

strive4peace

AWF VIP
Local time
Today, 10:35
Joined
Apr 3, 2020
Messages
1,004
hi Flippie,

Welcome!

like CJ said, a listbox only looks at 1 character and jumps to it. So even if your column had all the characters in one place, you couldn't do it. As you typed characters, it would just move around. A listbox is not also a textbox

A combo box is a combination of a listbox and a textbox.

So perhaps what you want to do is add a textbox yourself. Or, put a combo box above the listbox and synchronize them. You can use the CHANGE event of the combo or textbox to move the list.
 
Last edited:

MajP

You've got your good things, and you've got mine.
Local time
Today, 11:35
Joined
May 21, 2018
Messages
8,527
The select as you type thread modifies a listbox to allow you to find more than the first character. Look at the demo. Works with or without the text box.
 

FLIPPIE

New member
Local time
Today, 16:35
Joined
Apr 8, 2020
Messages
4
1586360653586.png

HI GUYS,
THANKS FOR ALL THE ADVICE, BUT I AM JUST A NOVIS. SO I ADDED A PICTURE OF THE SITUATION. WHEN I CLICK IN THE LISTBOX ON THE SELECTED RECORD (THE 4TH IN THE GROUP) THE FORM COMES UP WITH THE FIRST IN THE GROUP, NOT THE 4TH. AND I NEEDED THE FOURTH, SO WHAT DO I WRONG ?
 

Attachments

  • 1586360454500.png
    1586360454500.png
    125.6 KB · Views: 75

theDBguy

I’m here to help
Staff member
Local time
Today, 08:35
Joined
Oct 29, 2018
Messages
21,468
View attachment 80697
HI GUYS,
THANKS FOR ALL THE ADVICE, BUT I AM JUST A NOVIS. SO I ADDED A PICTURE OF THE SITUATION. WHEN I CLICK IN THE LISTBOX ON THE SELECTED RECORD (THE 4TH IN THE GROUP) THE FORM COMES UP WITH THE FIRST IN THE GROUP, NOT THE 4TH. AND I NEEDED THE FOURTH, SO WHAT DO I WRONG ?
Hi. Did you see my post earlier? You'll need a "unique" value to distinguish which of the rows you selected.
 

FLIPPIE

New member
Local time
Today, 16:35
Joined
Apr 8, 2020
Messages
4
Hi. Did you see my post earlier? You'll need a "unique" value to distinguish which of the rows you selected.
THE RECORD ITSELF IS UNIQUE. CAN I USE THAT ?. I WAS LOOKING FOR A UNIQUE RECORD
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:35
Joined
Oct 29, 2018
Messages
21,468
THE RECORD ITSELF IS UNIQUE. CAN I USE THAT ?. I WAS LOOKING FOR A UNIQUE RECORD
But how is the record "unique?" If it's because of all the columns together, then no, unless you do what was suggested earlier and concatenate all the columns together to create a unique column. Don't you have an ID field though?
 

strive4peace

AWF VIP
Local time
Today, 10:35
Joined
Apr 3, 2020
Messages
1,004
hi Flippie,

AutoNumbers are perfect to use for a primary key!
  1. add an AutoNumber field to your table.
  2. mark it as the primary key
  3. in the form design, modify the RowSource to make the AutoNumber field be the first column
  4. Make it hidden -- set the ColumnWidths property so that the first column has a width of 0
if you don't know how to do any of these things, first see if you can figure it out yourself. If you can't, then ask! these are important things to know ~
 

FLIPPIE

New member
Local time
Today, 16:35
Joined
Apr 8, 2020
Messages
4
Thanks guy, i have it working now. (added autonumber) and thanks to strive4pease and thedbguy for your patience
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:35
Joined
Oct 29, 2018
Messages
21,468
Thanks guy, i have it working now. (added autonumber) and thanks to strive4pease and thedbguy for your patience
Hi. You're welcome. We're all happy to assist. Good luck with your project.
 

Users who are viewing this thread

Top Bottom