combo box with 3 items not displaying

ChrissyH

New member
Local time
Today, 23:13
Joined
May 7, 2013
Messages
2
I have two synchronised combo boxes that are working brilliantly except for 1 thing.

The two boxes are Site and Building. I find a site from the Site box dropdown and only the buildings for that site are shown in the Buildings box dropdown. Perfect!

However, I have got 3 fields showing in my Buildings dropdown.

Private Sub cboSite_AfterUpdate()
Me.cboBuilding.RowSource = "SELECT BuildingName, BuildingCode, Status FROM " & _
"BuildingT WHERE SiteID = " & _
Me.cboSite & _
" ORDER BY BuildingName"
Me.cboBuilding = Me.cboBuilding.ItemData(0)
End Sub

that is BuildingName, BuildingCode and Status.

All three show in the dropdown
BUT
only BuildingName shows in the actual Building Box and I would like all 3 to be visible once I have decided on the building name I need!!

Can this be done by changing
Me.cboBuilding = Me.cboBuilding.ItemData(0) (as above)
to
Me.cboBuilding = Me.cboBuilding.ItemData(0), Me.cboBuilding.ItemData(1), Me.cboBuilding.ItemData(2)
or something similar??

Or do I need to create 2 new boxes to return the other values?? I am so close to achieving what I want with this form!! I have trolled through the internet and cannot find a solution!!
 
Suggestion: create a query and insert a field concatenating the three fields. Use this query as a control source for the second combobox.
 
Alternative suggestion:

Create two new text boxes and set the source for the first one Buildingcode to =Building.column(1) and the second (Status) to =Building.column(2)

They should update automatically but if not, in the after update event of the building combo put the following

BuildingCode.Requery
Status.Requery
 
CJ_London's suggestion sounds more proffessional. My suggestions is from a newby. But i will do the way London said. I will steel his sugestion also. :D
 

Users who are viewing this thread

Back
Top Bottom