Solved

ms access forms with subforms commad

Posted on 2011-02-18
2
193 Views
Last Modified: 2012-05-11

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
Comment
Question by:Shen
  • 2
2 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34930713


<...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
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 34930829
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question