473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 txtCorrectiveAction, cmboEmployeeName, 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 txtCorrectiveAction, 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 3583
rkc
jd****@yahoo.com 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 txtCorrectiveAction, cmboEmployeeName, 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 txtCorrectiveAction, 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
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...
8
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...
0
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...
2
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 ...
5
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...
5
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...
2
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...
12
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...
2
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.