Originally posted by LosLobo
'When the Building is selected, the appropriate Room list will
'display in the drop down list of CboRoom
Code:
With Me![Room]
If IsNull(Me!Building) Then
.RowSource = ""
Else
.RowSource = "SELECT [RoomNumber], [RoomDescription] " & _
"FROM tblRoom " & _
"WHERE [BuildingID]=" & Me!Building
End If
Call .Requery
End With
End Sub
Now go to control cboRoom and set it's Column widths property to 3cm;0cm (instead of Auto).
This column width of 3cm reffers to first column in the drop-down list (RoomNumber), and 0cm reffers to RoomDescription which is present, but is not visible in the list.
Now set RoomDescription 's control Row source to: =cboRoom.Column (1)
Note: First column has index 0, second colum has index 1 etc.
Comment