473,748 Members | 6,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Must Populate Fields in Subforms - Access 2003

On my form I have a tab control that contains 12 subforms. The
child/master field that links the main form to each subform is
IncidentNo. Each subform is used to record a corrective action that
needs to be taken when an incident occurs. The user must enter the
corrective action in a text box, then choose from a combo box the name
of the employee who is assigned the task of completing the corrective
action, and in another text box, assign a due date the task is to be
completed by.

So I've got subforms named sbfrmCA1, sbfrmCA2, up to sbfrm12, each with
fields named txtCorrectiveAc tion, cmboEmployeeNam e, and txtDueDate on a
tab control named tabCtlCAs. What I'm trying to accomplish is that
when the user clicks a button to close the main form, if he entered
anything in txtCorrectiveAc tion, he must have populated the other 2
fields in the subform. If he left one or both of the fields empty, I
want a message box to pop up and let him know what he's left undone on
which subform. How do I "cycle" through each subform to verify that he
entered all 3 fields?

TIA,
JD

Nov 13 '05 #1
1 3615
rkc
jd****@yahoo.co m wrote:
On my form I have a tab control that contains 12 subforms. The
child/master field that links the main form to each subform is
IncidentNo. Each subform is used to record a corrective action that
needs to be taken when an incident occurs. The user must enter the
corrective action in a text box, then choose from a combo box the name
of the employee who is assigned the task of completing the corrective
action, and in another text box, assign a due date the task is to be
completed by.

So I've got subforms named sbfrmCA1, sbfrmCA2, up to sbfrm12, each with
fields named txtCorrectiveAc tion, cmboEmployeeNam e, and txtDueDate on a
tab control named tabCtlCAs. What I'm trying to accomplish is that
when the user clicks a button to close the main form, if he entered
anything in txtCorrectiveAc tion, he must have populated the other 2
fields in the subform. If he left one or both of the fields empty, I
want a message box to pop up and let him know what he's left undone on
which subform. How do I "cycle" through each subform to verify that he
entered all 3 fields?


You can loop through a forms control collection, identify subform
controls and obtain the control's form object like so:

Dim c as Access.Control

For Each c In Me.Controls
If c.ControlType = acSubform Then
'pass c.Form to a validation routine
End If
Next


Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1799
by: Arnold | last post by:
Hi there, I have a form to organize bottles in mind, but am unsure if it will work. Here's some background info: Mainform = frmProduct, which contains fields for pricing, status, etc. of complete bottles, as well as an image control for a thumbnail of a complete product (bottle + cap). The mainform has 2 subforms that must be visible and side-by-side:
8
12052
by: Dimitri Furman | last post by:
Given: Access 2002/2003 A subform in datasheet or continuous view, placed on a tab page (this last may or may not matter) Conditional formatting applied to some controls on the subform - format expressions are the same for all controls Under some undetermined circumstances, when such subform is displayed, the controls on the subform start to visibly flicker, the cursor in the subform stops blinking, and CPU utilization goes to 100%....
0
2244
by: Jack | last post by:
Gday everyone, I'm dearly hoping Stephen Lebans is going to update his masterpeice to stop the mouse wheel scrolling to work on subforms *he has indicated this to me but of course beggers can't be choosers here so I have no idea when this would be done*. I'm just wondering if anyone has gotten around the problem some other way? --Original Thread---
2
5373
by: Chand | last post by:
Hello Everyboy I am creating a small scale db with following fields in the table and form for the data entry purpose. Product ID Product Name Manufacturer Location 101 Pen ABC & Co. Boston
5
2527
by: Daniel Walzenbach | last post by:
Hi, I need to know how I could populate a word file from within ASP.NET and stream it out to some user (I can rely on all users have at least Word XP installed). The preferable solution would be to have a word template on the server which is populated in the asp.net application and then streamed out to the user. Also acceptable would be to open a template on the client's computer using automation and fill this file (if this is possible)....
5
1583
by: kaosyeti | last post by:
hey.. i have a report that is based on a 12 field simple query. i've been working on it for a while and had to restart some areas so i know i went over the 755 control limit but only until i reset the report with the saveas/rename trick. however, that's not helping me now. i only have about 150 controls in the report right now but when i try to run it, it won't even open the report. i keep getting an error about having too many fields. ...
2
6068
by: Reginald Bal | last post by:
Hello, I created a main form with 2 subforms. In an attempt to move to the next record (or new record) on the main form I get the error " Method 'requery' of object '_Subform' failed". The database closes after answering the popup window (Microsoft Access has encounterd a problem and needs to close. .....) Does anybody has an idea why I'm having this problem?
12
18162
by: M G Henry | last post by:
I have a tabbed form that contains 12 different "pages" and when I try and run the form I get the error message too many fields defined --- which I believe is the 255 field limit in the record source. I was wondering, that if I were to break the pages down to include subforms... is the number of fields contained in the subforms added to the field limit for the main form ??? Is there some other way to work around this error message ???
2
3360
by: seltzer | last post by:
I am using Access 2000 but I also have the 2003 version. I am working on creating a data entry form in Access for a research study. Since there is a maximum of 255 fields per table in Access, I have to split the fields up (unfortunately). I am creating a form for each section and all of the respective fields, and then I am putting all these forms into one larger form as subforms. I have a few questions & am hoping someone has answers: ...
0
9548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.