I have a combo box named cboRCNo which is populated with a list of names. This is it's row source:
SELECT tblController.RCNo, tblController.RCName
FROM tblController
ORDER BY tblController.RCName;
I have a table of events (tblEvent) that has all of the data associated with an event - for this example I am concerned with these columns:
Date, ActivityID, LocationID and RCNo.
Of the columns listed above, all but Date is actually a lookup value to another table.
on my form, I have a combo box (see cboRCNo above) that I want to query tblEvent, and populate a lisdtbox (lstEvents) with the Date, Activity, and Location of all of the events in tblEvents that are associated with the Name (RCNo) selected in the combo box.
To do this I placed this in the After Update event of cboRCNo:
lstEvents.RowSource = "SELECT tblEvent.EventDate, tblEvent.ActivityID, " _
& "tblEvent.LocationID FROM tblEvent WHERE RCNo=" & cboRCNo
It worked - sorta - except that instead of seeing the "names" of the activities and locations listed in tblEvent, I get the number instead - even though the table (tblEvent) appears to save the name of the looked up value.
Can someone please tell me how to get the names of the looked up values to populate the listbox instead of the numbers in the linked table?
Thanks, PDUNCAN
Memphis, TN - USA
When I die, I want to die like my grandfather-- who died peacefully in
his sleep. Not screaming like all the passengers in his car.
SELECT tblController.RCNo, tblController.RCName
FROM tblController
ORDER BY tblController.RCName;
I have a table of events (tblEvent) that has all of the data associated with an event - for this example I am concerned with these columns:
Date, ActivityID, LocationID and RCNo.
Of the columns listed above, all but Date is actually a lookup value to another table.
on my form, I have a combo box (see cboRCNo above) that I want to query tblEvent, and populate a lisdtbox (lstEvents) with the Date, Activity, and Location of all of the events in tblEvents that are associated with the Name (RCNo) selected in the combo box.
To do this I placed this in the After Update event of cboRCNo:
lstEvents.RowSource = "SELECT tblEvent.EventDate, tblEvent.ActivityID, " _
& "tblEvent.LocationID FROM tblEvent WHERE RCNo=" & cboRCNo
It worked - sorta - except that instead of seeing the "names" of the activities and locations listed in tblEvent, I get the number instead - even though the table (tblEvent) appears to save the name of the looked up value.
Can someone please tell me how to get the names of the looked up values to populate the listbox instead of the numbers in the linked table?
Thanks, PDUNCAN
Memphis, TN - USA
When I die, I want to die like my grandfather-- who died peacefully in
his sleep. Not screaming like all the passengers in his car.