I have a headache am trying to solve I hope someone helps me with this one. I have a code which autopopulate dates based on a selection criteria. What I want to is that it should skip all weekends whiles it populates the fields. I have tried the Weekend functions but it simply does not work. am hoping that someone helps me out. this is my code - If MsgBox("Are you SURE? This will erase all payment data and create a new schedule?", vbYesNoCancel + vbCritical, "Falcon Engine") <> vbYes Then Exit Sub
-
-
If IsNull(Forms!LoanF!PaymentAmount) Then
-
MsgBox "You need to calculate the payment amount first"
-
Exit Sub
-
End If
-
-
DoCmd.SetWarnings False
-
-
DoCmd.RunSQL ("DELETE * FROM ScheduleT WHERE LoanID=" & Forms!LoanF!LoanID)
-
Me.Requery
-
DoCmd.GoToControl "PaymentNumber"
-
-
Dim BBal As Currency
-
Dim Counter As Long
-
Dim CurDate As Date
-
Dim X As Integer
-
Dim TotalPrin As Currency, Correction As Currency
-
-
BBal = Forms!LoanF!TotalAmountDue
-
Counter = 1
-
CurDate = Forms!LoanF!FirstPaymentDate
-
-
While BBal > 0
-
DoCmd.GoToRecord , , acNewRec
-
PaymentNumber = Counter
-
[ClientName] = Forms!LoanF!ClientName
-
[AccountNumber] = Forms!LoanF!AccountNumber
-
Counter = Counter + 1
-
DueDate = CurDate
-
CurDate = IIf(Forms!LoanF!RepaymentFrequency = "Daily", (DateAdd("d", 1, CurDate)), IIf(Forms!LoanF!RepaymentFrequency = "Weekly", DateAdd("ww", 1, CurDate), IIf(Forms!LoanF!RepaymentFrequency = "Fortnightly", DateAdd("ww", 2, CurDate), IIf(Forms!LoanF!RepaymentFrequency = "Monthly", DateAdd("m", 1, CurDate), IIf(Forms!LoanF!RepaymentFrequency = "Quarterly", DateAdd("q", 1, CurDate), IIf(Forms!LoanF!RepaymentFrequency = "Semi Annually", DateAdd("yyyy", 1, CurDate) / 2, IIf(Forms!LoanF!RepaymentFrequency = "Yearly", DateAdd("yyyy", 1, CurDate), "Invalid Reapayment Frequency")))))))
-
AmountPaid = 0
-
InterestPaid = (Forms!LoanF!TotalAmountDue - Forms!LoanF!Principal) / (Forms!LoanF!TotalAmountDue) * AmountPaid
-
PrincipalPaid = AmountPaid - InterestPaid
-
RegularPayment = 0
-
ExtraPayment = 0
-
Penalty = 0
-
BeginningBalance = BBal
-
AmountDue = Forms!LoanF!PaymentAmount
-
InterestDue = Round(BeginningBalance * ((Forms!LoanF!InterestPerMonth) / (Forms!LoanF!NumberOfPayments)), 2)
-
PrincipalDue = AmountDue - InterestDue
-
If BBal < Forms!LoanF!PaymentAmount Then
-
EndingBalance = 0
-
AmountDue = AmountDue
-
PrincipalDue = PrincipalDue
-
Else
-
EndingBalance = BeginningBalance - AmountDue
-
-
End If
-
-
BBal = EndingBalance
-
Wend
-
-
DoCmd.GoToRecord , , acNewRec
-
-
Forms!LoanF.Requery
-
DoCmd.SetWarnings True
-
Every thing is fine with the exception of weekends included in the DUEDATE. Please i need help.
I seems to be asking more questions because I have not even stepped in a programming class before!
3 840 zmbd 5,501
Expert Mod 4TB
yashuaking
Please, new question, new thread - we respectfully ask that each thread be kept to a single question. This makes it easier to stay focused on the goal and for others with a similar problem to find the help they need.
I’ve gone ahead and split this out to a new thread for that reason; however, the title is somewhat generic and can be changed should you desire.
Ok thanks Zmbd. I would do well to comply to the guidelines
But please I need help with the post
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Oren |
last post by:
Hi all
I really need direction in this one
I have a WinApp in C# and I need to load data at the beginning and save data o
exit - just simple things like: this.Top, this.Left etc..
I have...
|
by: Glen |
last post by:
I need to make a project for school that intergrates Frontpage,
access, word and powerpoint. I wanted to make something that would be
usefull for work also. Anyways, here goes.
I hope to create...
|
by: Celia Oblinger |
last post by:
Please understand that I am not asking HOW to do something - but, rather, I
just need some advise on what "technology" or method I should employ...
The problem is this:
I have a client for...
|
by: Raj |
last post by:
Hi All,
Currently, i'm working in VC++. We are having a migration project in
..net. I'm very much interested to work in C# and planning to write
certification program in web applications. I'm not...
|
by: simonalexander |
last post by:
I have got a homework task to do and I have started the work but I cannot finish it.Can someone please help me finish the code. The help given is much appreciated.
The actual specifications are...
|
by: Remington |
last post by:
Back again, thirsting for knowlege. :)
http://www.thescripts.com/forum/showthread.php?p=2314976#post2314976
Was my last thread. I am still working on the same project, but a different stage.
I...
|
by: suppyzw |
last post by:
Hello everyone
I have to impliment a new barcode system in a warehouse. Meaning i have to replace pre-existing sacnners and the middleware that feeds into a SQL database.
The Wifi coverage...
|
by: suppyzw |
last post by:
Hello everyone
I have to impliment a new barcode system in a warehouse. Meaning i have to replace pre-existing sacnners and the middleware that feeds into a SQL database.
The Wifi coverage...
|
by: Sathya9999 |
last post by:
Hello,
I am new to db2 Administration.. Need guidance from you guys..
Is there any list of command we come accros day to day life.. and any documentation, I have most of DB2 site docuements.....
|
by: santus |
last post by:
Hello,
I've just join this forum and i need help about using matlab function from .net.
I need to make a program to plot data into 2D graphics and the program use use mathematics functions.
...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |