Solved Listbox

I used a font called Consolas.

I guess you don't have it installed (The one in your screenshot is different).

Pick a fixed-width font.

Remember to size the label to fit.
 
Changed the font to Courier New. Still the same.
Changed the font to Consolas . Still the same.

Note: It seems it's because of the space you've used between letters. If I delete the space between letters, it works.
 
OK

Can you show a screenshot of the label in design view as it was before you removed the spaces?

Annotation 2020-06-15 024442.png
 
I've already shown it in #18 post.

I'll upload another one in design view in a minute.
 
this is the label and its Format property sheet.

2020-06-15_11-02-03.jpg


Edit: The property sheet belonged to the form. I updated the image.
 
Now that I think more carefully, it may be my side problem. My Locale in control panel is set to Japanese. And I had at least another problem with a download here. Everybody was insisting the file is OK, but it didn't work for me.
So this may be another instance of the problem caused by Windows Locale. If it works for you, you can ignore my comments.
 
Interesting, because the font displays as Consolas in design view and the 'Z' is aligned to the edge of the listbox. In your previous image the font was different and the 'Z' displayed to three left of the edge.
 
It's an issue that could affect other users with different locales so I think better to leave them.
 
I have tried to do that but it doesn´t work. I attach my DB here. Maybe I did something wrong
Heres an example. I only did up to letter f but it should give you the idea.
Note that I changed your table name and listbox name. I wouldnt use special characters in names and wouldn't name a listbox the same as a field.
It´s perfect thank you :)
 
I think you can get a nicer aesthetic with a tab control. And a lot easier IMO and code is still one line.
Code:
Private Sub tabOne_Change()
  Me.Namn.RowSource = "SELECT ID, Namn FROM [Tbl-Kund] WHERE Namn LIKE '" & Chr(65 + Me.tabOne.Value) & "*';"
End Sub
alpha.png
 

Attachments

I did something like this not with a list but with a datasheet

I might make another example of it as did it 15 years ago
2020-06-15 (7).png
 

Users who are viewing this thread

Back
Top Bottom