Combo Box Formatting

A

Alex H

Hi

I have formatted my field to have a small top and left indent, just to make
tyhe data more readable. Is there any way to do the same withg a Combo Box?

Thanks

Alex
 
K

Kevin

You can try resizing the combo box to a slightly larger size than the text
that will fill it. This should add the spaces above the text. To add spaces
before, you could preceed the data with spaces. In order to do that, you
will need to set up a query to feed the Combo Box. That query should take
the data from the table and add the spaces. Let's say the field was called
FirstName. You would set the field in the query to be:
FirstName2: " " & FirstName
This would add 5 spaces before the FirstName. Your ComboBox would use the
FirstName2 field.

You might need to strip the spaces out by using the "len", "right" command.
Let's say the combobox is called cmbName. You would use:

'***Code Start
dim varFirstName as String
dim varFinalFirstName as String

varFirstName = me.cmbName.Value
varFinalFirstName = right(varFirstName,(len(varFirstName)-5))

'***code end

This is going to find the length of the full field, subtract the 5 spaces,
and use the "Right" command to pull on the FirstName.

HTH,
Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top