MrChameleon
New member
- Local time
- Today, 03:03
- Joined
- Sep 25, 2017
- Messages
- 5
Hi,
I have an Access 2010 DB with a specific form on which there are 9 combos. I have a button I want greyed out until all of the combos have a valid selection made. I've played around with a couple of ways of achieving this, such as a crazy IF not (isnull(cmb1)) and (isnull(cmb2))...etc THEN cmd1.enabled=true but this is really unwieldy and finding exactly the right event to place the code in is problematic (unless put in every combos AfterUpdate event which just makes the form's code module horrendous).
I can't seem to find a simple method of achieving this. I did write a loop with a flag variable which cycled through all the form's controls and if they were combo type set the Boolean flag to false if it found one that had no value) and only set the enabled property of the button to true if the flag was true at the end of the loop. That seems an entirely quicker and more sensible way of doing it but I still can't figure where's the best event to put this code in - the user could update the combos in any order and I don't want to force it.
Any ideas gratefully received.
I have an Access 2010 DB with a specific form on which there are 9 combos. I have a button I want greyed out until all of the combos have a valid selection made. I've played around with a couple of ways of achieving this, such as a crazy IF not (isnull(cmb1)) and (isnull(cmb2))...etc THEN cmd1.enabled=true but this is really unwieldy and finding exactly the right event to place the code in is problematic (unless put in every combos AfterUpdate event which just makes the form's code module horrendous).
I can't seem to find a simple method of achieving this. I did write a loop with a flag variable which cycled through all the form's controls and if they were combo type set the Boolean flag to false if it found one that had no value) and only set the enabled property of the button to true if the flag was true at the end of the loop. That seems an entirely quicker and more sensible way of doing it but I still can't figure where's the best event to put this code in - the user could update the combos in any order and I don't want to force it.
Any ideas gratefully received.