For starters, I am using Access 2002. I am not smart enough to even ask this question clearly, so I will make an example and then ask the question:
tblWorkOrder includes maintenance work requests for an apartment building. The primary key is WorkOrderNumber. The field tblWorkOrder.LocationID defines the apartment number where the maintenance problem exists.
tblMaintenance records include one or more maintenance visits to complete each work order. The records are related through WorkOrderNumber. There is also a field called LocationID in tblMaintenance. Usually, the LocationID in each table is identical. But sometimes completing the maintenance request may mean doing some work in a neighboring apartment location (water on the ceiling in apartment 202 means a water leak in 302), so the LocationID in tblMaintenance is occasionally a different location.
In frmMaintenance, I use a combo box to choose the tblMaintenance.LocationID.
Here is the problem: I would like the combo box on frmMaintenance to initially display the location found at the related tblWorkOrder.LocationID because this will be the correct location most of the time. If work has to be performed in a different location, the user can choose from the pull-down combo box to make the change.
I am thinking that the right code following an "After Update" event on the WorkOrderNumber is what I need. You can probably tell by my problem description that I am pretty much a novice at using VBA on forms, but I would appreciate an example of how this should be coded.
Regards,
BP
tblWorkOrder includes maintenance work requests for an apartment building. The primary key is WorkOrderNumber. The field tblWorkOrder.LocationID defines the apartment number where the maintenance problem exists.
tblMaintenance records include one or more maintenance visits to complete each work order. The records are related through WorkOrderNumber. There is also a field called LocationID in tblMaintenance. Usually, the LocationID in each table is identical. But sometimes completing the maintenance request may mean doing some work in a neighboring apartment location (water on the ceiling in apartment 202 means a water leak in 302), so the LocationID in tblMaintenance is occasionally a different location.
In frmMaintenance, I use a combo box to choose the tblMaintenance.LocationID.
Here is the problem: I would like the combo box on frmMaintenance to initially display the location found at the related tblWorkOrder.LocationID because this will be the correct location most of the time. If work has to be performed in a different location, the user can choose from the pull-down combo box to make the change.
I am thinking that the right code following an "After Update" event on the WorkOrderNumber is what I need. You can probably tell by my problem description that I am pretty much a novice at using VBA on forms, but I would appreciate an example of how this should be coded.
Regards,
BP