Access 2007 Combo Box Truncating Leading Spaces (1 Viewer)

JohnThePom

New member
Local time
Tomorrow, 01:00
Joined
Apr 17, 2012
Messages
2
I am populating a 2 column combo box in code using the AddItem method.

The first column is hidden and contains a Country or Region ID, the second column contains the Country or Region Name.

What I want to do is to create Groups - a region, then list the countries indented under that region.

The effect I want is :

Europe
France
Germany
Spain
etc...
Asia
China
Japan

To achieve this I add a few leading spaces to the Country Name, unfortunately the AddItem method appears to be truncating the leading spaces.

Is there an ASCII code I could use instead of space that would be invisible in the combo box.

I had been using Microsoft Forms 2 Combo Box and this had worked OK but now Access 2007 had the AddItem method thought I would start using that.


Any suggestions how to remedy this ??

Cheers.

John
 

JohnThePom

New member
Local time
Tomorrow, 01:00
Joined
Apr 17, 2012
Messages
2
Oooooppss, it appears this forum suffers the same problem as the MS Acccess Combo Box AddItem method as it truncates leading spaces !!

The example above the countries are indented !!


Europe
France
Germany
Spain
etc...
Asia
China
Japan
 

missinglinq

AWF VIP
Local time
Today, 18:00
Joined
Jun 20, 2003
Messages
6,423
This will do it in a simple Textbox, adding three Spaces before the text, and should work in your situation:

Me.Text2 = Chr(32) & Chr(32) & Chr(32) & "Germany"

Linq ;0)>
 

Users who are viewing this thread

Top Bottom