S
SG
I am trying to create linked list boxes but I am having a little
difficulty..
I have the following piece of code on he load form with popluates list0 with
room conditions this is fine.
Private Sub Form_Load()
Me.List0.RowSource = _
"SELECT DISTINCT RoomCondition FROM tblRoomCondition"
End Sub
The next bit is where I am getting a little lost. What I want to happen is
when a user clicks on a room condition it displays a list of rooms by type
example Double. I have a table called tblrooms which stores the room name,
conditionid, room typeid, roomclassid and floors id. I need to know how to
get the room type name and not the ID number (primary key)
Private Sub List0_AfterUpdate()
With Me.List2
.RowSource = _
"SELECT DISTINCT Conditionid FROM tblRooms " & _
"Where Conditionid = " & Chr(34) & Me.List0 & Chr(34)
.Requery
End With
Me.Label3.Caption = Me.List2.ListCount & _
" Rooms " & _
Me.List0
End Sub
Any help would be much appreciated I've tried for hours but not getting
anywhere.
Thank you in advance.
S
difficulty..
I have the following piece of code on he load form with popluates list0 with
room conditions this is fine.
Private Sub Form_Load()
Me.List0.RowSource = _
"SELECT DISTINCT RoomCondition FROM tblRoomCondition"
End Sub
The next bit is where I am getting a little lost. What I want to happen is
when a user clicks on a room condition it displays a list of rooms by type
example Double. I have a table called tblrooms which stores the room name,
conditionid, room typeid, roomclassid and floors id. I need to know how to
get the room type name and not the ID number (primary key)
Private Sub List0_AfterUpdate()
With Me.List2
.RowSource = _
"SELECT DISTINCT Conditionid FROM tblRooms " & _
"Where Conditionid = " & Chr(34) & Me.List0 & Chr(34)
.Requery
End With
Me.Label3.Caption = Me.List2.ListCount & _
" Rooms " & _
Me.List0
End Sub
Any help would be much appreciated I've tried for hours but not getting
anywhere.
Thank you in advance.
S