I am working on a Property Management database. I am having trouble with one small thing. It's insignificant to me, because I can work around it, but if this would be used by others, I want to make sure they can't cause errors in data.
I have a main form (frmTenants_Tenancy) which displays someone's tenancy. On that form is a listbox (lstExistingTenants) which shows the tenants under that tenancy. Clicking on one of them brings up their information on a subform (sfrmTenants_Tenant) through master/child link by TenantID. This will also requery another listbox (lstParkingAgreements) which shows a list of all vehicles parked by that tenant. Clicking on one of the vehicles in that listbox will display vehicle/agreement information in another subform (sfrmTenants_Parking) through master/child link by ParkingID.
My problem right now is that when I click a tenant in lstExistingTenants and then click a vehicle in lstParkingAgreements, the vehicle details will display...but if I then click another tenant in lstExistingTenants, the vehicle details don't go away, regardless of whether the 2nd tenant has parking agreements. It only changes when I click another agreement.
I would like the Parking subform to essentially refresh to blank when the tenant is changed, so that there's no possibility of information being put in under the wrong tenant. I have tried requerying the subform, tried me.refresh, tried setting focus to the subform and going to a new record (this doesn't work because it interferes with a beforeupdate event to handle unsaved changes).
Any advice?
I have a main form (frmTenants_Tenancy) which displays someone's tenancy. On that form is a listbox (lstExistingTenants) which shows the tenants under that tenancy. Clicking on one of them brings up their information on a subform (sfrmTenants_Tenant) through master/child link by TenantID. This will also requery another listbox (lstParkingAgreements) which shows a list of all vehicles parked by that tenant. Clicking on one of the vehicles in that listbox will display vehicle/agreement information in another subform (sfrmTenants_Parking) through master/child link by ParkingID.
My problem right now is that when I click a tenant in lstExistingTenants and then click a vehicle in lstParkingAgreements, the vehicle details will display...but if I then click another tenant in lstExistingTenants, the vehicle details don't go away, regardless of whether the 2nd tenant has parking agreements. It only changes when I click another agreement.
I would like the Parking subform to essentially refresh to blank when the tenant is changed, so that there's no possibility of information being put in under the wrong tenant. I have tried requerying the subform, tried me.refresh, tried setting focus to the subform and going to a new record (this doesn't work because it interferes with a beforeupdate event to handle unsaved changes).
Any advice?