Link to home
Start Free TrialLog in
Avatar of Shen
ShenFlag for United States of America

asked on

ms access forms with subforms commad


We have a form with a command button in the main form and a tab with 3 subforms of different record types. In the subforms i have a check box, that when is checked it makes 3 fields visible. The problem that i have is that if a user checks the box but does not enter information in the fields, when they press the command button in the form it takes them out to the main menu and won't let me edit the fields.  I tried putting code in the close event of the subforms to cancel the command button event in the form and display a message if not entry was made in the fields but nothing works.  I also tried the unload event with no success.

I put code in the check box click and on current events to make the fields visibles.

 
 
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image



<...when they press the command button in the form it takes them out to the main menu >

here is one way to make this work.
you can set the enabled property of the command button to No as the default.
Enable the command button only when an information was entered to the controls/fields.
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial