hugomadail
Registered User.
- Local time
- Today, 04:46
- Joined
- Aug 31, 2018
- Messages
- 25
Hello, in my database I have a form (frmStores) with 2 combobox:
cbRegion
- Lists RegionName and RegionID from tblRegions
- This combobox is unbound
cbPlace
- Lists PlaceName, PlaceID and RegionID from tblPlaces
In database, tblRegion is related with tblPlaces because tblPlaces has field RegionID and each place belongs to a region only.
There is tblstores where frmStores gets all data. tblStore has PlacesID field because its associated to a place. I didnt add a RegionID field because the place ID is already associated with a region.
In form frmStores, when opening/moving to next record, I want to:
1) unbound cbRegion get RegionID from cbPlace "maybe [cbPlace].Column(3) ?" so it would show a number if place has region association or be empty if there is no association
2) cbRegion filter cbPlace to only show Places from that RegionID since we got the RegionID on 1). If it was empty on 1), cbPlaces would drop-arrow results would be empty yoo
3) When moving to another record in frmRegion, 1) and 2) must work as described too.
(This would be easy if tblStores had RegionID too because Region would be auto shown on frmStores and then I would use [cbRegion] as criteria to cbPlace source, but I'm trying to avoid that, I want DB to have field reduction - if Store is assigned to a place, that place is already suposed to be in a specific region, so add regionID to tbl Stores would be a second location field)
I hope explanation was clear, can someone help ?
cbRegion
- Lists RegionName and RegionID from tblRegions
- This combobox is unbound
cbPlace
- Lists PlaceName, PlaceID and RegionID from tblPlaces
In database, tblRegion is related with tblPlaces because tblPlaces has field RegionID and each place belongs to a region only.
There is tblstores where frmStores gets all data. tblStore has PlacesID field because its associated to a place. I didnt add a RegionID field because the place ID is already associated with a region.
In form frmStores, when opening/moving to next record, I want to:
1) unbound cbRegion get RegionID from cbPlace "maybe [cbPlace].Column(3) ?" so it would show a number if place has region association or be empty if there is no association
2) cbRegion filter cbPlace to only show Places from that RegionID since we got the RegionID on 1). If it was empty on 1), cbPlaces would drop-arrow results would be empty yoo
3) When moving to another record in frmRegion, 1) and 2) must work as described too.
(This would be easy if tblStores had RegionID too because Region would be auto shown on frmStores and then I would use [cbRegion] as criteria to cbPlace source, but I'm trying to avoid that, I want DB to have field reduction - if Store is assigned to a place, that place is already suposed to be in a specific region, so add regionID to tbl Stores would be a second location field)
I hope explanation was clear, can someone help ?