Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

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.

 
 
0
Shen
Asked:
Shen
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:


<...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.
0
 
Rey Obrero (Capricorn1)Commented:
or use the beforeupdate event of the form to check for controls/fields that are not filled

see codes from this thread

http://www.experts-exchange.com/Database/Miscellaneous/Q_22653980.html#a19351039
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now