Count Number of Deposits

  • Thread starter Thread starter Dave Elliott
  • Start date Start date
D

Dave Elliott

I have a form where I enter deposits.
There are 10 fields to add up (Deposit Amounts)
Cust1 Thru Cust9 Plus a single Cash Deposit named Cash
Cust1
Cust2
etc...
Cash


Equals total number of deposits

How can I count the number of deposits in a textbox that equal Cust1 Thru
Cust9 Plus Cash?
 
Your structure is allll wrong here. You have a one-to-many relationship
here. One customer and up to ten deposits. You should have a table with
four fields, Customer, DepositAmount, DepositType, and DepositDate.

You'd most likely have other tables to define your customer information and
other important items.

Then you could create queries and reports to pull deposits and sum them and
count them.

Rick B
 
Well, maybe I could have set it up better, however it works fine like it is
except , I have to manualy
enter the total number of deposits.
Is there a DCount code that I could use to perform the calculation?
 
Dave,

I am not really sure what you mean, on the basis of the information you
have provided so far, but would this do the job?...
Put a calculated field in a query, like this...
TotalDeposits: [Cust1]+[Cust2]+[Cust3]+...+[Cust9]+[Cash]
 
Cust1, etc... are all textboxes with deposits in them.i.e. Cust1
=$50.00+Cust2=$0.00 , etc...

Need the COUNT of these. Cust1 would equal 1 + Cust2 if it is>0 ='s a
Count of 2, etc...



Steve Schapel said:
Dave,

I am not really sure what you mean, on the basis of the information you
have provided so far, but would this do the job?...
Put a calculated field in a query, like this...
TotalDeposits: [Cust1]+[Cust2]+[Cust3]+...+[Cust9]+[Cash]

--
Steve Schapel, Microsoft Access MVP


Dave said:
Well, maybe I could have set it up better, however it works fine like it
is except , I have to manualy
enter the total number of deposits.
Is there a DCount code that I could use to perform the calculation?
 
If Cust1>0 Then it equals a COUNT of 1
If Cust2>0 Then the COUNT would be 2
etc...

Steve Schapel said:
Dave,

I am not really sure what you mean, on the basis of the information you
have provided so far, but would this do the job?...
Put a calculated field in a query, like this...
TotalDeposits: [Cust1]+[Cust2]+[Cust3]+...+[Cust9]+[Cash]

--
Steve Schapel, Microsoft Access MVP


Dave said:
Well, maybe I could have set it up better, however it works fine like it
is except , I have to manualy
enter the total number of deposits.
Is there a DCount code that I could use to perform the calculation?
 
Dave,

Ok, thanks for the further information, it certainly helps to understand
the question. Try this...
TotalDeposits: Abs(([Cust1]>0)+([Cust2]>0)+...+([Cust9]>0)+([Cash]>0))
 
Thanks, this is the final code, but I get a #errror ????????????

=Abs(([Cust1]>0)+([Cust2]>0)+([Cust3]>0)+([Cust4]>0)+([Cust5]>0)+([Cust6]>0)+([Cust7]>0)+([Cust8]>0)+([Cust9]>0)+([Cash]>0))



Steve Schapel said:
Dave,

Ok, thanks for the further information, it certainly helps to understand
the question. Try this...
TotalDeposits: Abs(([Cust1]>0)+([Cust2]>0)+...+([Cust9]>0)+([Cash]>0))

--
Steve Schapel, Microsoft Access MVP

Dave said:
If Cust1>0 Then it equals a COUNT of 1
If Cust2>0 Then the COUNT would be 2
etc...
 
Thanks, Everything works

Steve Schapel said:
Dave,

Ok, thanks for the further information, it certainly helps to understand
the question. Try this...
TotalDeposits: Abs(([Cust1]>0)+([Cust2]>0)+...+([Cust9]>0)+([Cash]>0))

--
Steve Schapel, Microsoft Access MVP

Dave said:
If Cust1>0 Then it equals a COUNT of 1
If Cust2>0 Then the COUNT would be 2
etc...
 
Back
Top