Experts:
First of all, I apologize in advance for this lengthy post. However, IOT get to my question, I do need to provide some decent amount of background. Ultimately, I need some assistance with "enabling/disabling a control" on one form based on a count of list box items on a second form.
The attached database contains 2 tables, 2 queries, and 2 forms. There are hidden objects but again, for addressing this questions, there's no need to look at those hidden objects. In order to "help you help me", please view the objects in the order summarized below:
1. View form "F00_Billets":
- Upon opening the form, you'll see a "Go to" combo (under the dark blue banner) and three listboxes (CFT, OPT, WS).
- Use the "Go to" combo to navigate back and forth between the records.
- For illustration purposes, only 3 out of 7 records contain a value in the listboxes. More specifically, the below summary shows which record has one CFT, one OPT, and one WS:
* BIN 0001111 -> 1 CFT
* BIN 0002222 -> 1 OPT
* BIN 0003333 -> 1 WS
* BIN 0004444 through 0007777 "Not assigned to a WQSB!"
- Please note that the "message" box is for testing only and it merely summarizes the counts for the CFT + OPT + WS. Later on, I will disable the message box... right now they helped me to validate the correct accounting of list box items.
2. View form "F01_Staffmember":
- Upon opening, use the "Go to" combo to navigate from one staff member to the next.
- In total, there are 7 staff members. These staff members are linked to the following billets (see Q100_N1S_BilletsStaffmembers):
* 0001111 -> Fonda
* 0002222 -> Eastwood
* 0003333 -> Day
* 0004444 -> Robertson
* 0005555 -> Washington
* 0006666 -> Wallach
* 0007777 -> Van Cleef
Additional background:
- I track CFT, OPT, and WS assignments based on the "BIN" number (e.g., 0001111, 0002222, etc.).
- Based on the billets to staffmembers relationship, however, I could inherently also say that staff member "Fonda" is assigned/linked to one "CFT".
- Altenatively, for example, staff member "Eastwood" is assigned/linked to one "OPT".
So far so good...
More background:
- Again, a CFT, OPT, and WS is an "activity" that remains pretty much constant.
- In other words, these activies (essentially, cross-functional team membership or operational planning teams) will remain linked to a BIN/billet and rarely change.
- However, staffmembers (employees) will join/leave the organization frequently.
- Now, if a new staff member joins the organization and he/she is assigned to a BIN/billet which is linked to a CFT or OPT or WS, then this new employee must complete certain training.
- Alternatively, in case the employee fills a BIN/billet that is NOT linked to the CFT/OPT/WS, then no training is required (unless there's a change where, e.g., 0004444 is linked to a CFT/OPT/WS later on).
All that said, here's what I need some help with:
- On form "F01_Staffmember", I have a combo called "Training Status". Values can take on either "Complete" or "Not Complete".
- Now, in this example, the first staff member is "Doris Day". Again, she's BIN = 0003333... which in turn, is linked to a "WS".
- So, in this case, I want the combo to be enabled so that I can change the value from, e.g., "Not Complete" to "Complete" (once the training reqs have been satisfied).
- Now, if I were to navigate from "Doris Day" to "Denzel Washington" (assigned to BIN 0005555), I want the combo to be disabled.
- In other words, I do NOT want the user to be able to accidentally change the training status value to "Complete" since Denzel Washington does NOT need to fulfill the training reqs.
My question:
How can I drive the enabling of the "Training Status" combo box on form F01_Staffmember where -- on form F00_Billets -- the "If Me.lstCFT_Summary.ListCount + Me.lstOPT_Summary.ListCount + Me.lstWS_Summary.ListCount > 0" is TRUE?
Alternatively, once I navigate to a staff member who is NOT assigned to any CFT/OPT/WS, I want the "Training Status" combo to be disabled.
Thank you advance,
EEH