Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2006
    Posts
    15

    Question Unanswered: Calculating total income from 2 subforms

    hi guys...

    got a problem here.... i have to fields namely txtincome, txttotalinc and netincome.... txtincome and txttotalinc are from 2 different tables and are located in 2 different subforms on a main form.... wherelse netincome is located on the main form and the value is store in another table... tat means the 3 fields are all stored on 3 separate tables.... the thing i hope to do is tat i hope to add the total of the 3 fields together and displayed it on the main form.... how can i do tat?

    thanks in advance...

  2. #2
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372

    Try this:

    =Nz(Forms!MainFormName!SubForm1Name!txtincome + Forms!MainFormname!
    SubForm2Name!txttotalinc + Me.netincome),0

  3. #3
    Join Date
    Apr 2006
    Posts
    15
    hmm... below is wat i keyed in to the textbox control source...

    =Nz(Forms!Form!PARTICULARS OF MEMBERS OF PATIENT TABLE subform!Txtincome + Forms!Form!Family Members Particulars2!Txttotalinc + Me.GROSS PERINC),0

    but there seems to be an error.... the error is "the expression u entered contains an invaild syntax. You may have entered an operand without an operator."

    thanks...

  4. #4
    Join Date
    Apr 2006
    Posts
    15
    sorry... the correct codes are below... but still have the same error...

    =Nz(Forms!Medifund Entry Form!PARTICULARS OF MEMBERS OF PATIENT TABLE subform!Txtincome + Forms!Medifund Entry Form!Family Members Particulars2!Txttotalinc + Me.GROSS PERINC),0

    any ideas??

    thanks

  5. #5
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372
    Try this:
    =Nz([Forms]![Medifund Entry Form]![PARTICULARS OF MEMBERS OF PATIENT TABLE subform]![Txtincome] + [Forms]![Medifund Entry Form]![Family Members Particulars2]![Txttotalinc] + Me.[GROSS PERINC]),0

  6. #6
    Join Date
    Apr 2006
    Posts
    15
    thanks for the help....

    but if i wana store the total income the the database? what should i do?

    i tried typing the codes below on form load , form current etc. but it just wont store and cant even reflect the total income out on the textbox...

    Private Sub Form_Load()

    'Me.TOTFAMINC1 = [Forms]![Medifund Entry Form]![PARTICULARS OF MEMBERS OF PATIENT TABLE subform].[Form]![Txtincome] + [Forms]![Medifund Entry Form]![Family Members Particulars2].[Form]![Txttotalinc] + [Forms]![Medifund Entry Form]![GROSS PERINC]

    Me.Requery

    End Sub


    any help is appreciated...
    thanks in advance...

  7. #7
    Join Date
    Apr 2006
    Posts
    15
    by the way TOTFAMINC1 is the name of the textbox i want the total income to show and display... and i have link the textbox control source to TOTFAMINC.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •