Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform

Status
Not open for further replies.

OCM

MIS
Sep 12, 2002
220
US
Greetings,
1. I have a main form called Household and a subform called Applicants. In the main form I have NumOfApp field, where I would like to automatically be filled depending on how many people applied in the Applicants form.
2. Also, I have DateReceived and DateDue fields in the Applicants form.
The DateDue is calculated by adding 10 workdays(DateReceived + 9) to the
DateReceived and put the result into DateDue field automatically.
So the user don’t have to figure out manually when the DateDue is.
How can this be accomplished?
Thanks,
DD
 
Ok, fine... I'll be the one to do it.

DD... You've got to give a little bit more information here. What kind of database are you running? What type of server side scripting is supported? How are you accessing the db?
 
Greetings,
I posted this before, and left out some information. I’m using Access 2000 and my questions:

1. I have a main form called Household and a subform called Applicants. In the main form I have a field called NumOfApp. I would like NumOfApp to be automatically filled depending on how many people applied in the Applicants form (subform).

2. In my subform I also have fields like DateReceived, DateDue, and AppStatus (with combo boxes New, Dss, Eapp etc.)
If the user selects New from AppStatus drop down, DateDue is calculated by adding 10 workdays to the DateReceived field. How can I make DateDue to be filled automatically (DateReceived + 9) when New is selected from AppStatus drop down field?

Thank you in advance,
DD
 
1. Go to the form's design view.
2. Open the Properties box of AppStatus.
3. Click on the Events tab.
4. Click on "Change". Click on the three-dot button at the right of it. [...]
5. A little pop-up will appear. Select Code Builder.
6. You'll be in the code window now. Enter the following code:
Code:
If AppStatus.Value = "ADD" Then
    DateDue.Value = CDate(DateReceived.Value) + 9
End If

The variable names may need to be changed, depeding on what the name of the controls are. i.e. the name of your AppStatus control may be "cboAppStatus" or it may be some awful name like "Combo15". You will have to replace my names with the correct ones, or else this will not work. --
Find common answers using Google Groups:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top