I’m currently working on a POB (Persons On Board) database, and have a problem when needing to do a check if a cabin/bed is occupied or no.
A little information on how it works:
When planning crew on board an oil rig, you can choose from e.g. 60 cabins, with e.g. 2 beds in each cabin. Cabins are normally numbered e.g. “310”, which is third floor, cabin 10, and beds are “A” and “B”. Two persons normally share a cabin. One is working day shift, the other one night shift. You will normally not have two persons on day shift or two persons on night shift in the same cabin (called ‘hot-bunking’). Only in extreme cases.
What I’m after is a way for the database to check if a cabin is either in use already, or planned in use, and if so-called ‘hot-bunking’ is occurring, when I click a command button (there are various txtboxes / option groups on the form, where user can enter/choose cabin/bed/Working shift etc).
I have a query with needed information, i.e.:
- CabinNumber
- Bed
- InUse (yes/no)
- PlannedForUse (yes/No)
- WorkingShift
And then of course fields for the name of the person occupying the cabin / bed.
Example:
A person is coming on board and is planned for Cabin 310, Bed A, and he will be working Day Shift. When clicking the command button, I need to check if:
- Cabin 310, Bed A being occupied/planned occupied by any one else? If in use, then update not possible, and action to be taken. If not in use, then proceed to below.
- Cabin 310, Bed B is in use/planned in use, and if it is, it needs to check if this is Day Shift or Night Shift. If this is Day Shift, then update not possible, and action to be taken. If Night Shift, then all ok, and information can be updated.
I’m not looking for some finalized code, but I would appreciate if someone can assist with a “push” in the right direction.
Thanks.
Anders
A little information on how it works:
When planning crew on board an oil rig, you can choose from e.g. 60 cabins, with e.g. 2 beds in each cabin. Cabins are normally numbered e.g. “310”, which is third floor, cabin 10, and beds are “A” and “B”. Two persons normally share a cabin. One is working day shift, the other one night shift. You will normally not have two persons on day shift or two persons on night shift in the same cabin (called ‘hot-bunking’). Only in extreme cases.
What I’m after is a way for the database to check if a cabin is either in use already, or planned in use, and if so-called ‘hot-bunking’ is occurring, when I click a command button (there are various txtboxes / option groups on the form, where user can enter/choose cabin/bed/Working shift etc).
I have a query with needed information, i.e.:
- CabinNumber
- Bed
- InUse (yes/no)
- PlannedForUse (yes/No)
- WorkingShift
And then of course fields for the name of the person occupying the cabin / bed.
Example:
A person is coming on board and is planned for Cabin 310, Bed A, and he will be working Day Shift. When clicking the command button, I need to check if:
- Cabin 310, Bed A being occupied/planned occupied by any one else? If in use, then update not possible, and action to be taken. If not in use, then proceed to below.
- Cabin 310, Bed B is in use/planned in use, and if it is, it needs to check if this is Day Shift or Night Shift. If this is Day Shift, then update not possible, and action to be taken. If Night Shift, then all ok, and information can be updated.
I’m not looking for some finalized code, but I would appreciate if someone can assist with a “push” in the right direction.
Thanks.
Anders