Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two Combo box questions 2

Status
Not open for further replies.

robojeff

Technical User
Dec 5, 2008
220
US
I have two Combo box questions:

1. Is there a way to center the text in each column of a Combo box?

Setting the text align to center for the properties of the Combo box don't seem to work in my access 2007 as seen in the picture below where all text fields in the combo box are left justified...

2. In the form view, my Combo box looks blank until I click on the pull down and than all of the contents are shown. then if I select a record, it becomes highlighted. And then after it is selected only one number appears on the combo box (see picture below)

How do I get the title to always appear and the title and the selected record to appear once a record has been selected?



combobox.jpg



Thanks!
 
I don't believe you can center the content of the columns in a combo box. You can set all of the columns widths to 0 until the first column that you want to display when the combo is not dropped down.

Duane
Hook'D on Access
MS Access MVP
 

I changed the combo box back over to a list box so that I can see what is selected after the selection is made...

I do notice that after I execute my code to update the table information that is shown in the list box that the info displayed in the list box does not update until I select another item in the list box.

Is there a way to update this without having to select some other item in the list box?
 


Yes the control is bound to a table item but does not appear on the form as updated if it is selected in the list box until after it is not selected even though the table value has changed...

If I set a break point in my code right after the table is updated, the data in the list box will update with the change (with the item selected) when the break point occurs.... Without the break point, the list box data remains the same until it is unselected.
 
I would change it back to a Combo box then I am back the problem that I originally reported.

With the combo box, I see a blank looking box on a form until I select the down arrow and then I can see the whole list but after something is selected, only the first column of the item selected is displayed and no title as shown below:

combobox.jpg


The List box displays the data as I would like to see it but I don't know how to make
the combo box display this information:


irethedo


(
 
I clicked the Post button too quickly. If you don't understand the suggestion, please reply with the Row Source SQL view of the combo box as well as which columns you want displayed.

Duane
Hook'D on Access
MS Access MVP
 


Sorry, I don't understand the suggestion...

Here is the Row Source information that I use for the list box or the combo box:

Code:
SELECT D.ID AS Device, D.DevCode, D.Asm, D.Desc, D.SBU, D.IDate, D.IsBy, D.FMAC, D.LMAC, D.ID
FROM M_tbl AS D
ORDER BY D.ID;


thank you
 
dhookom said:
as well as which columns you want displayed
When the combo is closed, you can only view one column. This column can be an expression like:
SQL:
D.DevCode & " - " & D.Asm & " - " & D.Desc & " - " & D.SBU & " - " & D.IDate
You can also add more text boxes with control sources like:
Code:
=cboDeviceID.Column(1)
You should set the Enabled property to No and the Locked property to Yes.


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top