7 Replies - 762 Views - Last Post: 14 December 2016 - 07:29 AM

#1 Bonekit  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 71
  • Joined: 09-May 16

MS Access 2016 Income / Outcome Problem

Posted 12 December 2016 - 02:53 AM

Hello Folks,

I have a problem with my account book.
I created a subform "sfrmMain" as datasheet with two textboxes:
txtIncome =Wenn([Art]="Einkommen";[Summe])
txtOutcome = Wenn([Art]="Ausgaben";[Summe])

both textboxes are working great, but now comes the problem.

In frmMain he show me only the Income or the Outcome not both.
Why? There are Income entries and Outcome entries.

Two Pictures for better explain.
Posted Image
Posted Image

Regards,
Tobias

Is This A Good Question/Topic? 0
  • +

Replies To: MS Access 2016 Income / Outcome Problem

#2 andrewsw  Icon User is online

  • say what now
  • member icon

Reputation: 6408
  • View blog
  • Posts: 25,888
  • Joined: 12-December 12

Re: MS Access 2016 Income / Outcome Problem

Posted 12 December 2016 - 03:20 AM

What is your function Wenn doing?

I suspect it is only showing a value based on the current row selected, where Art is either Einkommen or Ausgaben.
Was This Post Helpful? 0
  • +
  • -

#3 Bonekit  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 71
  • Joined: 09-May 16

Re: MS Access 2016 Income / Outcome Problem

Posted 12 December 2016 - 04:19 AM

Hi, thanks for the fast reply.

My function "Wenn/When" is doing: When Type = "Income or Outcome" is then show the amount in textbox.

The Textbox is working good, txtincome adds both entries in Income and show the result in txtIncome.

I think the failure is not in sfrmMain.
It must be in frmMain, but where?
Was This Post Helpful? 0
  • +
  • -

#4 Bonekit  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 71
  • Joined: 09-May 16

Re: MS Access 2016 Income / Outcome Problem

Posted 13 December 2016 - 02:47 PM

My bad, you´re right.
The When-Function delivered me only the selected amount not all from income.
So i tried the sum-function, but this function delivered me all amounts.
Is there a way to use the sum-function with criterion?

Greets
Tobias
Was This Post Helpful? 0
  • +
  • -

#5 andrewsw  Icon User is online

  • say what now
  • member icon

Reputation: 6408
  • View blog
  • Posts: 25,888
  • Joined: 12-December 12

Re: MS Access 2016 Income / Outcome Problem

Posted 14 December 2016 - 02:27 AM

You can use Sum() with a nested IIf() function, summing 0 for a non-matching criteria.
Was This Post Helpful? 0
  • +
  • -

#6 Bonekit  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 71
  • Joined: 09-May 16

Re: MS Access 2016 Income / Outcome Problem

Posted 14 December 2016 - 04:13 AM

Ok, last question:
How?

I tried a few things but nothing is working.
The Functions names are in german...
1. =Summe(If([Art]="Einkommen";[Summe]))
2. =Summe(IIf([Art]="Einkommen",[Summe]))
3. =Summe(If([Art]="Einkommen",[Summe],0))



To be honest, i have no clue about what i have to do.
Please help me...

Greets
Tobias
Was This Post Helpful? 0
  • +
  • -

#7 andrewsw  Icon User is online

  • say what now
  • member icon

Reputation: 6408
  • View blog
  • Posts: 25,888
  • Joined: 12-December 12

Re: MS Access 2016 Income / Outcome Problem

Posted 14 December 2016 - 04:16 AM

=Sum(IIf([Art]="Einkommen",[QtyToSum],0))
Was This Post Helpful? 1
  • +
  • -

#8 Bonekit  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 71
  • Joined: 09-May 16

Re: MS Access 2016 Income / Outcome Problem

Posted 14 December 2016 - 07:29 AM

Now i get the message from access:

"Your Code is syntactical wrong."

=Summe(IIf([Art]="Einkommen",[Summe],0))


I got it:
=Summe(Wenn([Art]="Einkommen";[Summe];0))


I had to use ; instead of ,

This post has been edited by Bonekit: 14 December 2016 - 07:34 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1