Sum Of Subform Field
May 21, 2006
Hi,
Just to give you a bit of background to my database...
A job (project) can be created and purchase orders can be attached to it. The customer may pay for the job when the work has been carried out or pay in installments.
So each job can have a number of payments against it.
http://img.photobucket.com/albums/v368/flemmo/jobs.gif
Here is my form:
http://img.photobucket.com/albums/v368/flemmo/jobpayment.gif
I'm trying to get the 'Total Payments' box to add together all the payment amounts of the subform (datasheet) using =Sum([PaymentAmount]) but this comes back with #Error.
Anyone know how to do this?
Thanks.
View Replies
ADVERTISEMENT
Sep 4, 2014
I have a form called frm002_PAF_MonitoringMAIN and on this form I have a subform called frm002_PAF_Monitoring. The subform has a button to another form for contact details called Contact_Details. The Contact_Details form opens with the details of the person who I have selected on frm002_PAF_Monitoring. There are some fields on frm002_PAF_Monitoring that I would like to be populated on Contact_Details when opened, like FirstName and LastName. How can I do it?I have tried on afterupdate event on Contact_Details below but those don't work:
Me!FirstName=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me!FirstName=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]
View 11 Replies
View Related
Sep 1, 2006
I almost have this form done.
I have a form with a combo box, and 2 subforms from it. When you select in the combo box (Group), it brings up the choices (Sections) for that group in a subform. Then there is another subform, that is supposed to bring up a series of questions that are related to the section that has been selected. The question field has a drop down to a list table, that has all the questions. Once the question has been selected, it stores in a Master table. The relationship is there. If you try to select any questions that do not pertain to the section, it gives you an error message.
What I need it to do, is when the section is selected, filter out the questions that pertain to that section, and have those questions be the only ones available in the drop-down list to choose.
I know that I need to have an After Update code once the section has been selected, but not sure how the coding should be.
I hope that someone can help with this!
:confused:
View 1 Replies
View Related
Sep 1, 2006
I have a form that is almost complete
I have a form with a combo box, and 2 subforms from it. When you select in the combo box (Group), it brings up the choices (Sections) for that group in a subform. Then there is another subform, that is supposed to bring up a series of questions that are related to the section that has been selected. The question field has a drop down to a list table, that has all the questions. Once the question has been selected, it stores in a Master table. The relationship is there. If you try to select any questions that do not pertain to the section, it gives you an error message.
What I need it to do, is when the section is selected, filter out the questions that pertain to that section, and have those questions be the only ones available in the drop-down list to choose.
I know that I need to have an After Update code once the section has been selected, but not sure how the coding should be.
I hope that someone can help with this!
View 1 Replies
View Related
Jun 1, 2006
I have a mainform. I select from a couple of combo boxes. Based upon these selections, it pulls up appropriate info in subform #1.
There is a field in subform #1 which I want to populate a field in subform #2 with (automatically).
What kind of "event" is this? After/before? I tried everything, nothing works.
Let's try these naming conventions:
Main form = mainform
Subform #1 = subform1
Subform #2 = subform 2
Field Subform #1 = fieldsubform1
Field Subform #2 = fieldsubform2
Help me write the code and help me locate where to put that code. It's been troubling me for a long time.
Thanks, I hope someone can help me out.
View 2 Replies
View Related
Jul 18, 2013
How can I get the value from a field in one table (in the sub form) to copy/insert into a field in another table (in the main form) when adding a new record?The main form and sub form are linked using parent/child linking, and the sub form is in a tab.I have table A (Visit Dates) in the main form which is used to record the date of a visit to a church. Table B (Quarters and Peals) is used to record an event that took place at that church during that visit. Note that not all visits in table A require a record to be created in table B - but half or more do.
In tables A and B I have a field called "QuarterOrPealID" and these are both primary keys, though the field in table B is set to 'no duplicates' and in table A it's set to 'duplicates allowed', as table A has its own auto number/pk. They are both linked in the relationships.
So, when I add a new record to table A using the main form, I might then need to click on the tab in the sub form to create a new record in table B, which has to be linked to the same record in table A. When the "QuarterOrPealID" auto number/pk is generated in the sub form (table B), I need that value to update to the "QuarterOrPealID" field of the main form (table A), so that when I'm viewing these records the form pulls all the information nicely together.
View 10 Replies
View Related
Oct 24, 2013
I want to filter my subform data, to only show records where field A is a higher value than field B.
Code:
Me.MySubform.Form.Filter = "A > B"
Me.MySubform.Form.FilterOn = True
This way it doesn't find field B.
Code:
Me.MySubform.Form.Filter = "A > " & MySubform.Form!B
Me.MySubform.Form.FilterOn = True
This way it seems to filter all record to the field B value of the first record.
View 5 Replies
View Related
Aug 19, 2015
I am currently stuck on set focus property. I have a main from with nested subform. I am trying to move the focus from last field of the subform to another field on the main form.
Customers(mfrm)....>Addresses(sfrm)...>Orders(sfrm Add)......>OrdDetails(sfrmOrders)
Now I have a field name [Securedesign] in frmOrderdetails and I want the tab order to navigate to field [CustomerID] in frmAddresses which is a subform to frmCustomers.
View 2 Replies
View Related
Feb 12, 2015
I have a main form and a subform.
Both forms have the field called JobID in common.
Both forms have a field called JobStatus.
Any easiest solution so that After I Update the field called JobStatus in the subform, it changes the field called JobStatus in the main form to the value which was selected from the subform?.
View 3 Replies
View Related
Oct 24, 2005
hi, i would like to be able to prevent a user from being able to change a field (lock a field) in a main form if a field in a subform is complete. (the field in the subform is named: "new_weekly_base" if this is complete then i would like the field: "weekly base" to be locked on the main form. is this possible?, please help.
the main form is named: "SCREEN-MAIN"
the subform is named: "SCREEN-SUBFORM"
(the main form has a button on it which loads the subform.)
ive tried the below code but it doesnt work, any help would be excellent.
-------------------------------------------------------
Private Sub Form_BeforeUpdate(Cancel As Integer)
If [NEW_WEEKLY_BASE] >= 0 Then
With Me.WEEKLY_BASE
.Visible = True
.Enabled = False
End With
End If
End Sub
------------------------------------------------
View 4 Replies
View Related
Jul 6, 2014
I want to create a different rowsource-query for a lookup field (field1) in each record in a subform. The rowsource changes dependent on the value in another field (field2) in the same record. How can this be done?
- I tried to change the rowsource-query in an eventmacro when the focus is set to field1, but this ofcourse changes the rowsource for all field1's and makes the allready selected values unvisible.
- I think I have to include the value of record 'field2' in the rowsource query, but i cannot find a way to include that value in the query.
Something like:
Lookup field1 in the subform contains this rowsource
- SELECT CUSTOMER.Id, CUSTOMER.AGE, CUSTOMER.NAME
FROM CUSTOMERS
WHERE (CUSTOMER.AGE= me![field2]);
me![field2] however does not function
View 5 Replies
View Related
Nov 26, 2013
I am doing this all as a bound form
My main form got a field named 'PersonID'.
My subform also got a field called 'PersonID'
The subform 'PersonID' populates however the mainform 'PersonID' does not.
I just need to write code, or maybe do something that will copy the number from subform and paste it in the mainform field, maybe at the click of my save button.
View 8 Replies
View Related
Nov 2, 2012
I need to choose a value, which will be a number from one field (TaxRate) and have it update a field on my subform which also is a number (TaxRate)
TaxRate set subform TaxRate to value chosen
main form is named AddProducts and subform is named AddProductsSubform
View 14 Replies
View Related
Jul 20, 2015
I am trying to create a simple budget planner. So far, I have the following table:
tbl_account [id|acc_type|acc_name|balance|memo]
tbl_expense [id|exp_date|exp_amt|exp_acct|exp_payee|exp_type]
tbl_expense_cat [id|cat_name|cat_type]
tbl_income [id|inc_date|inc_amt|inc_acct|inc_payee|inc_type]
tbl_income_cat [id|cat_name|cat_type]
The relation now are:
[tbl_account:id] ---> [tbl_income:exp_acct] --> [tbl_income:id]
|_______> [tbl_expense:inc_acct] --> [tbl_income:id]
I have 3 subform on the main form:
[account_sf]
[expense_sf]
[income_sf]
I have set all them to continuous. Now I have added 3 account in the tbl_account.
I wonder how to SUM all the income of certain account, and minus all expense of certain account, and have them showed in the subform tbl_account.
Here is the attach pics: Untitled.jpg
View 6 Replies
View Related
Feb 26, 2005
I have 10 fields on a subform. they are named value1 to value10 consecutively. I would like to loop thru them, and get their values to use in subsequent events. I tried the following to reference them...
Dim iLoop as integer
Dim fldVal as control
Dim ItemValue as string
For iLoop = 1 to 10
fldVal = ("Forms![Form 1]![Subform 1]!value" & iLoop)
ItemValue = fldVal
Next iLoop
I also tried a couple of other variations, but cannot get this **** thing to work. Any help would be appreciated.
View 2 Replies
View Related
Jun 22, 2006
I'm trying to link a form to open when a field is double clicked on the main form. When the form is opened it should open to the current record that is present on the subform.
In the opening form, I tried using a parameter query as the record source that references the current ID field on the subform. I think my problem is with referencing the value in the subform from the form that I am opening. I've read the FAQ for referencing to help me and so far this is what I've got as a parameter in the query for referencing is [Forms]![frmMainEntry].[Forms]![fsubWOArchive]![TrackingID]
The subform control on the main form is fctlWOArchive
The subform itself is fsubWOArchive
How do I get the value of the TrackingID field from a subform of another form?
Thanks,
PC
View 5 Replies
View Related
Jul 19, 2006
Hi!
I have Form1 with two subforms in. They are both on subform1 level (not nested).
From one of the subforms i can ask the parentform for a value in a textbox on parentform: Me.Parent!Controlname.Value
But:
How can i succeed updating a subforms textbox (called "textbox1"), when being on main (parent) form?
I have tried with this syntax: Me!Subform1.Form.textbox1.Value = "test"
Neither does: Me!Subform2.Form.textbox1.Value = "test" work..
Thanks for your help ;) I've spent hours with this one..
View 2 Replies
View Related
Apr 8, 2005
When I open the “FrmStudentEnrollment” form in the attached db and enter a license number in the License number field (this field is inside a subform) that is not in the db, the “FrmStudentInfo” form opens allowing student information to be entered. After entering student information in the “FrmStudentInfo” form I have a close command button to return to the “FrmStudentEnrollment” form.
This is where I need help! I would like, when returning to the “FrmStudentEnrollment” form for the focus to be on the “AttentDate1” field located in the subform “FrmStudentInfo”. I used the LicenseNo Combo Box NotInList VB from Northwind db but there seems to be problems here too.
View 1 Replies
View Related
Mar 29, 2014
I have a Main Form. Then I have a SubForm that have other two subforms and a button.These button open a new Form.I need a field of the SubForm in the new Form.I try with these, but doesn't works. I thing I try all the possibilities but nothing:
Code:
Me.Id_Episodio = Forms!Paciente!Subform1.Episodio_Sub!Id_Episodio
View 3 Replies
View Related
Sep 29, 2011
I am using Access 2000 to build a database of car parts, and the cars they are currently installed on. I can assign each item on the "parts" table to a particular car listed on the "cars" table (or to its current location if it is not on a car). I can look at the cars individually, and have a subform that shows the parts currently assigned to that car in a list. That much is great, and is exactly how I want it.
Here is my question:
One of the fields in the "parts" table is "hours." Every time I use a particular car, I would like to increment each of the parts assigned to that car with the hours they were used. Ideally, I would have a form called "Use Vehicle" or similar, and in it I could select the particular car from a dropdown, and a subform would show the particular parts assigned to it. Then, I want to either: a) push a button with a particular time increment (like 0.25 hours) OR b) just enter a value in a box, which would then ADD that number to the "hours" field for every part in the subform.
View 2 Replies
View Related
Dec 13, 2005
I want to open Outlook with the recipients name in the To: box by clicking on the email address held in a subform list field...
Any ideas?
Dave E
View 3 Replies
View Related
Mar 17, 2005
I have a form with a subform. I would like to make a field on the subform not visible if a field on the primary field is null. Can anyone help? Thanks.
View 1 Replies
View Related
Jun 15, 2005
Ok this is a bit long winded and I will try to explain,
I have a main form, with a title at the top, then a row of buttons underneath and underneath the buttons I have a sub form.
Some of the buttons can have a dual function (or multiple function) so rather than open up another form I have hidden text below the button, so that when the mouse moves over the button, the text becomes visible. this gives the impression of a drop down menu off that button.
However I cannot get the text to appear over the top of the subform, it only appears behind it.
To give an example of what the buttons and drop downs are for, one of the buttons is a reports page, rather than open another form I can have a list of the differnt reports I wish to run (currently they are text boxes with an on click event).
any advice woudl be much appreciate and even an alternative to what I am doing if anybody has one.
Many thanks
MattP
View 5 Replies
View Related
Aug 8, 2005
I haven't been able to figure out the code to require entry (for a new record) in a field on a subform - anyone can help with this?
The situation is a contacts database, and each new contact should have a (or multiple) Person Roles entered as well, which is their relationship to the organization.
View 2 Replies
View Related
Aug 16, 2005
Hi
I have read through this forum and found some help on this but can't get it working.
I have a subform
Activity
Contains a tab control with two tabs
Activity Details - Persons
I want to copy the address field from Activity Details tab to the Address field on persons tab
Code for the on click even twon't work. Can't find errrors. I know it is because I haven't referenced it properly.
Me.txtpersonBuildingNameNo = Me.txtactivityBuildingNameNo
Any help :)
View 3 Replies
View Related
Aug 31, 2005
Hi all, i have a form with a subform, the main form has a field named: "shiftname" and i would like it so that when the form is opened the cursor is on that field but instead the cursor is on the first field of my subform. Ive tried changing the tab order on the main form (selecting form header, then shiftname) but this doesnt seem to work :( is there a bit of code i can use to force the form to open with the cursor in the "shiftname" field instead?
View 3 Replies
View Related