Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


this loop is not doing what i want

dami049dami049 Member Posts: 3
hi guys,
am doing a program that calculate the total loans collected by an individual per month. the loans are stored in a recordset (Access) and at the end of the month my program is meant to run through the recordset calculate total loan per staff using their Id's and month date. this loop only calculates for the first staff. what do i do. Help please

With rsloan 'recordset that opens the table

loanmonth = Format(Date, "mmm") 'todays month
'calculating total loan
Do While Not .EOF 'runs through recordset
txtIOU.Text = Nostaff
loanid = !StaffNo
loandate = !Tdate
txtIOU.Text = Nostaff
loandate = Format(loandate, "mmm")
loanAmount = !Amount
If (loanmonth = loandate) And (Nostaff = loanid) Then
loantotal = loantotal + loanAmount 'sums loan
txtLoan.Text = loantotal
End If

End With


  • Shawn CarterShawn Carter Member Posts: 0

    _ // // free video tutorials and ebooks about { Python Ruby PHP C# Objective-C R JavaScript Scratch Delphi Visual Basic MATLAB Visual Basic .NET Java C Perl Swift C++ PL/SQL Go Assembly Scheme F# Apex Transact-SQL LabVIEW Bash Lisp ABAP Dart Logo Erlang SAS FoxPro Fortran D Scala Lua VBScript Awk Kotlin Hack Crystal COBOL Rust Ada Prolog Alice Julia ML Clojure }

Sign In or Register to comment.