Solved

ms access forms with subforms commad

Posted on 2011-02-18
2
192 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 119

Expert Comment

by:Rey Obrero
Comment Utility


<...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 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now