Get Count of Deposits on Form

D

Dave Elliott

I have a form where I enter deposits.
There is a control named Number Of Deposits, it should count how many
deposits were made.
Dep1 Thru Dep9 Plus a Cash Deposit named Cash
Tried module with this code in it, it does not work, also unsure of how to
call the module.
Any Suggestions?

Thanks,

Dave


Function GetNumDeposits() As Integer
Dim intCount As Integer

intCount = 0
If [Dep1] <> 0 And Not IsNull([Dep1]) Then intCount = intCount + 1
If [Dep2] <> 0 And Not IsNull([Dep2]) Then intCount = intCount + 1
If [Dep3] <> 0 And Not IsNull([Dep3]) Then intCount = intCount + 1
If [Dep4] <> 0 And Not IsNull([Dep4]) Then intCount = intCount + 1
If [Dep5] <> 0 And Not IsNull([Dep5]) Then intCount = intCount + 1
If [Dep6] <> 0 And Not IsNull([Dep6]) Then intCount = intCount + 1
If [Dep7] <> 0 And Not IsNull([Dep7]) Then intCount = intCount + 1
If [Dep8] <> 0 And Not IsNull([Dep8]) Then intCount = intCount + 1
If [Dep9] <> 0 And Not IsNull([Dep9]) Then intCount = intCount + 1
If [cash] <> 0 And Not IsNull([cash]) Then intCount = intCount + 1

GetNumDeposits = intCount
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top