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

x
?
Solved

Combo box List items become squares?

Posted on 2004-10-13
14
Medium Priority
?
260 Views
Last Modified: 2010-05-02
I have a dropdown combo box, populated by these values in the List property of the control:

-2
-1
0
+1
+2

When I remove -2 and -1, then re-examine the list contents, the 0 becomes an empty square character.  In fact, any other entry that I change becomes one of these characters.  I can't seem to cut-and-paste it here, but you've likely seen the character I'm referring to.  

What gives?
0
Comment
Question by:cphansen
  • 6
  • 4
  • 2
  • +1
13 Comments
 

Author Comment

by:cphansen
ID: 12305191
There's the character!  Where the hell did they come from?  My paste attempts?  Now I'm confused.
0
 

Author Comment

by:cphansen
ID: 12305200
Wow, it would appear my computer is at fault here.  I'm getting all kinds of anomalies when typing this reply.  I've rebooted to no effect for the problem in question.  Could it be my Windows install?
0
 
LVL 11

Accepted Solution

by:
dbrckovi earned 300 total points
ID: 12305433
Hi!

Can you answer this?

 - create a combobox, and paste this code:
'----------------------------------------------------
Private Sub Form_Load()
    Dim Item As String
   
    Combo1.Clear
    For x = -2 To 2
        Combo1.AddItem x
    Next x

    Me.Show

    For x = 0 To Combo1.ListCount - 1
        Item = Combo1.List(x)
        For Char = 1 To Len(Item)
            Print Asc(Mid(Item, Char, 1))
        Next Char
    Next x
End Sub
'-----------------------------------------------------------

When you run it, what do you get?
You should get these results on the left side of your form:
45  -
50  2
45  -
49  1
48  0
49  1
50  2


Are you getting the same results?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:dbrckovi
ID: 12305439
If you remove first two items like this:

'--------------------------------------------
Private Sub Form_Load()
    Dim Item As String
   
    Combo1.Clear
    For x = -2 To 2
        Combo1.AddItem x
    Next x

    Combo1.RemoveItem 0
    Combo1.RemoveItem 0

    Me.Show

    For x = 0 To Combo1.ListCount - 1
        Item = Combo1.List(x)
        For Char = 1 To Len(Item)
            Print Asc(Mid(Item, Char, 1)) & "   " & Mid(Item, Char, 1)
        Next Char
    Next x
End Sub
'---------------------------------------------
you should get:

48  0
49  1
50  2
0
 
LVL 32

Assisted Solution

by:Erick37
Erick37 earned 200 total points
ID: 12308089
Sounds like you have a hardware issue since the problem happened in your first post as well.  Perhaps when you cut and paste.

Those characters are:

debug.print Asc("") = 1
 
    and

Const vbKeyLButton = 1

Maybe your mouse and / or keyboard need a vacation.  Can you swap out the keyboard/mouse to eliminate that as the cause?
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12308572
Actualy almost all ascii codes from 0 to 31 are represented as "", or something similar depending on the font.

For example: None of these squares have the same ascii code. (Or atleast they shouldn't if they are saved as I posted them)

      


0
 
LVL 32

Expert Comment

by:Erick37
ID: 12308616
Yes, but the characters in the question are 1's

"What gives?" <---- all 1's
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12316358
You're right.
I just wanted to state that there are more ascii codes which are represented with a square.
I didn't mean to oppose to your comment, but to expand it.
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12316413
Anyway.

I'd like to suggest few more things that might help:

 - Maybe your font's are scrambled in some way. Try reinstalling them or using different fonts.
 - If your keyboead leayout is not set to English, try setting it to Englsih, or try setting all regional settings to your language/country
 - Try running a virus scan. Maybe you picked up some virus which scrambles your characters. http://housecall.antivirus.com/
 - Maybe it's hardware problem. Try swapping your keyboard as Erick37 suggested, or if you don't have another keyboard available try using On Screen Keyboard program:        Start -> Run -> type:  "osk"
            If the problem is solved using osk, then buy new keyboard.
 - If you have them available, try using different type of keyboard (USB, PS2)

 - If nothing else helpes, then first try to repair your Windows installation
 - If this won't help either, do a fresh reinstall
0
 
LVL 4

Expert Comment

by:AjithJose
ID: 12329158
Definitely font problem: Try changing the .Font property of combo box
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12563221
We can't know if some answer was correct becouse, after asking the qustion, author didn't respond.
We don't even know if it's hardware or software problem, but I'm sure Erick37's and my suggestions would solve it, so I suggest a split.
0
 

Author Comment

by:cphansen
ID: 12564671
My apologies.  I don't usually leave questions hanging.  I shelved this problem for a little while, as the problem is not a large concern, and more pressing matters have taken me away from this one.

I will get back to this today.

Craig
0
 

Author Comment

by:cphansen
ID: 12564747
Took another look at it.  The problem is gone.  The install is the same.  The keyboard is the same.  No fonts were changed.  No virus was found. I use NOD32, scan weekly, and have been since before this problem was posted.

I'm at a loss as to why, but at least it works.

I'll split the points across the board.  I guess this was just a weird one.

Craig

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

782 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