I'm currently working on an Access subform which is displayed in datasheet view on another form. The subform contains a combobox called "ResourceType" and a listbox called "ResourceName", along with a few other fields. When the form displays existing data, there is one row of data in the subform for each record in the "EventResourcesDetails" table.
The "ResourceType" combo box displays the ResourceType just fine. However, the "ResourceName" listbox displays the numeric record key, rather than the description field that I want to see. Here's some info on the fields:
1) ResourceType
RowSourceType: Table/Query
RowSource: SELECT [ResourceTypes].[ResourceTypeID], [ResourceTypes].[ResourceType] FROM ResourceTypes ORDER BY [ResourceTypes].[ResourceType];
ControlSource: ResourceTypeID
ColumnCount: 2
ColumnWidths: 0",2"
Bound Column: 1
2) ResourceName
RowSourceType: Table/Query
RowSource: SELECT [Resources].[ResourceID], [Resources].[ResourceName] FROM Resources
WHERE [Resources.ResourceTypeID]=[forms]![MediaResources]![MediaResourcesSubform]!ResourceType
ORDER BY [Resources].[ResourceName];
ControlSource: ResourceID
ColumnCount: 2
ColumnWidths: 0",2"
Bound Column: 1
The ResourceName field is displaying the numeric ResourceID rather than the ResourceName (ex. "5", not "VCR"
. If I click on the dropdown arrow for the listbox, I see the valid list of ResourceNames that apply to the selected ResourceType (as I should). But if I click on one of these names, the corresponding ResourceID is then displayed in the row.
How can I always see the valid ResourceName in the listbox display, instead of the ResourceID field?
Thanks for your help. (I'm fairly new to VBA, so please keep explanations simple...)
- Anita
The "ResourceType" combo box displays the ResourceType just fine. However, the "ResourceName" listbox displays the numeric record key, rather than the description field that I want to see. Here's some info on the fields:
1) ResourceType
RowSourceType: Table/Query
RowSource: SELECT [ResourceTypes].[ResourceTypeID], [ResourceTypes].[ResourceType] FROM ResourceTypes ORDER BY [ResourceTypes].[ResourceType];
ControlSource: ResourceTypeID
ColumnCount: 2
ColumnWidths: 0",2"
Bound Column: 1
2) ResourceName
RowSourceType: Table/Query
RowSource: SELECT [Resources].[ResourceID], [Resources].[ResourceName] FROM Resources
WHERE [Resources.ResourceTypeID]=[forms]![MediaResources]![MediaResourcesSubform]!ResourceType
ORDER BY [Resources].[ResourceName];
ControlSource: ResourceID
ColumnCount: 2
ColumnWidths: 0",2"
Bound Column: 1
The ResourceName field is displaying the numeric ResourceID rather than the ResourceName (ex. "5", not "VCR"
How can I always see the valid ResourceName in the listbox display, instead of the ResourceID field?
Thanks for your help. (I'm fairly new to VBA, so please keep explanations simple...)
- Anita