I'm currently working on an Access subform which is displayed in datasheet view on another form. The subform contains a combobox called "cboResourceType" and a listbox called "lboResourceName" (which is dependant on cboResourceType).
The "cboResourceType" combo box displays the ResourceType just fine. However, the "lboResourceName" listbox displays the numeric bound column, rather than the description field that I want to see. Here's some info on the fields:
1) Subform RecordSource:
SELECT EventResourcesDetails.*, [Resources].[ResourceName] FROM EventResourcesDetails, Resources WHERE ((([EventResourcesDetails].[EventID])=[forms]![MediaResources]![EventID]) And ([EventResourcesDetails].[ResourceID]=[Resources].[ResourceID]));
Redcordset Type: Dynaset (Inconsistent Updates)
2) lboResourceName
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 (there is a dropdown arrow, since the listbox is in datasheet view), 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.
I tried changing the controlsource from ResourceID to ResourceName. Then, when the subform first appears with data in it, all the listbox displays in each row appear to be fine, with the correct wording instead of the numeric id. But if I click on the dropdown arrow and choose a different option, the numeric ResourceID then appears in the display. And even worse, the numeric ResourceID then gets saved in the ResourceName field of the Resources table, instead of being saved in the ResourceID field of the EventResourcesDetails table! I definitely don't want to be updating the Resources table in this form! My updates are supposed to happen to the EventResourcesDetails table.
How can I always see the valid ResourceName in the listbox display (instead of the ResourceID field), and then save the new ResourceID in the EventResourcesDetails table?
Thanks for your help. (I'm fairly new to VBA, so please keep explanations simple...)
- Anita
The "cboResourceType" combo box displays the ResourceType just fine. However, the "lboResourceName" listbox displays the numeric bound column, rather than the description field that I want to see. Here's some info on the fields:
1) Subform RecordSource:
SELECT EventResourcesDetails.*, [Resources].[ResourceName] FROM EventResourcesDetails, Resources WHERE ((([EventResourcesDetails].[EventID])=[forms]![MediaResources]![EventID]) And ([EventResourcesDetails].[ResourceID]=[Resources].[ResourceID]));
Redcordset Type: Dynaset (Inconsistent Updates)
2) lboResourceName
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"
I tried changing the controlsource from ResourceID to ResourceName. Then, when the subform first appears with data in it, all the listbox displays in each row appear to be fine, with the correct wording instead of the numeric id. But if I click on the dropdown arrow and choose a different option, the numeric ResourceID then appears in the display. And even worse, the numeric ResourceID then gets saved in the ResourceName field of the Resources table, instead of being saved in the ResourceID field of the EventResourcesDetails table! I definitely don't want to be updating the Resources table in this form! My updates are supposed to happen to the EventResourcesDetails table.
How can I always see the valid ResourceName in the listbox display (instead of the ResourceID field), and then save the new ResourceID in the EventResourcesDetails table?
Thanks for your help. (I'm fairly new to VBA, so please keep explanations simple...)
- Anita