# Revision history [back]

### How to update a subform field based on a listbox selection

Hello,

I could use some guidance on updating a subform field based on a listbox selection. The database holds customer and workorder info.

In the Workorders form, I display data from the Workorders table in the main section--and related WorkorderServices in a Subform. The Subform also contains a ServiceName listbox--which is connected to a Services table.

Tables/ Relationships

Workorders
WorkorderID pk

WorkorderServices
WorkorderServicesID pk
WorkorderID fk
ServicesID fk
UnitPrice

Services
ServicesID pk
ServiceName - Attached to listbox
UnitPrice


The listbox "automatically" updates the Workorders.ServicesID field when I select a ServiceName. But, I also want to update the WorkorderServices.UnitPrice field with the Services.UnitPrice value.

### How to update a subform field based on a listbox selection

Hello,

I could use some guidance on updating a subform field based on a listbox selection. The database holds customer and workorder info.

In the Workorders form, I display data from the Workorders table in the main section--and related WorkorderServices in a Subform. The Subform also contains a ServiceName listbox--which is connected to a Services table.

Tables/ Relationships

Workorders
WorkorderID pk

WorkorderServices
WorkorderServicesID pk
WorkorderID fk
ServicesID fk
UnitPrice

Services
ServicesID pk
ServiceName - Attached to listbox
UnitPrice


The listbox "automatically" updates the Workorders.ServicesID field when I select a ServiceName. But, I also want to update the WorkorderServices.UnitPrice field with the Services.UnitPrice value.