Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

VB Calculating Monthly Payment

I'm trying to code an application to calculate a monthly payment for a loan. There is a textbox to enter the amount of the loan and the interest rates are all in a listbox and the terms(years) are in an option button array 2-5 years. I can get it to calculate a figure but it gives a rounded amount. I am so stuck. How do I code this to work correctly?

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Monthly Report
Hi there,
I am worrking on an Access 2000 database for a project for my university and I have two question where I don't know what to do. Probably easy, but we all start from the beginning....

We should list the monthly sales volume of the Sales Reps of our imaginary company (lets call it cX). I have done the querie, but now I have to limit it to this months sales only by some criteria in the "Order Date" field, so only orders from the current month are shown. How can I do this ??

cX (selling window and door frames) offers a special deal: "buy any 3 window frames WF5, WF6, WF7 or WF8 and ge one door frame DF1 or DF2 for free." I tried something like
=if([Product]="WF5" or "WF6" or "WF7" or "WF8",-([Price]![Product])="DF1" or "DF2",0)
but of course it must be something else.

I would be very pleased if someone could help me here.

Monthly Calendar
Is it possible to get the Calendar control from the date/time dialog using a windows API?

I know there is a generic calendar but the current day defys logic when you scroll back a page.

I would like to use a more sophisticated calendar that optionally supports click and drag over dates.

Weekly And Monthly
Q. pls...

How can i make a weekly report? (the data must be shown in grid)

ex. i have a table with inputs dating 1/1/03 to 3/31/03

i wanted an output from the table on a weekly basis

the starting day of the week is monday to sunday

can i have some codes... thanks in advance

output: in grid

week1(monday to sunday)
1/3/03(:note 1/3/03 is wednesday ) - 1/5/03
TOTAL # of calls

week2(monday to sunday)
1/6/03 - 1/12/03
TOTAL # of calls

week3(monday to sunday)
1/13/03 - 1/19/03
TOTAL # of calls

week4(monday to sunday)
1/20/03 - 1/26/03
TOTAL # of calls

week5(monday to driday)
1/27/03 - 1/31/03
TOTAL # of calls

february *week1 starts again*
week1(saturday to sunday)
2/1/03 - 2/2/03
TOTAL # of calls

Monthly Report
How can i make a report that will group by month thru sql code.
in example group a quantity in a order where month of the date field is th same.

Creating A Monthly Query
I do have a table that stores data using date, is there any possibility to query that table based on month, what I want to do instead of selecting the first day and last day of the month, I want to select the month name and the application gets the first and last day of the month and excute the query.

Monthly Payments Tracker
Im doing a soft for keeping track of monthly payments from customers. I need to do reports with info about who paid and who not on the 10th day of each month (due date). I want to know if I should use the system date and automatically run a procedure that inserts the following info in the database

in the case of the client that didnt pay:
IDclient : 1001
Month: March
payment: Overdue

or should I run the procedure manually every 10th???

Any idea about a database design for this program will be appreciated.
I also need some help and suggestions about late payments and advanced payments.

Thanks in advance.

Please Help Me Create Monthly Statements.
Hey Everyone
I have a program that creates Invoices for people who have not paid. And I have a Table called Transactions with such fields:


So to retrive the Debtor List I just run a query like this:


Select * from Transactions where Stautus='Unpaid'

And it works all what I wish to do is enhance this feature a bit by giving users an option so that they are able to mail the statement at month end. Right now what I have for that is:


Select * from Transactions where GroupID=77 And Status='Unpaid'

I ask users to enter a Group ID for the above query.
With the query mentioned above it returns all the unpaid transactions and I put them in a MS word tempelate and works all good. So how can I give users a feature that at month, the statements get created automatically so that users dont have to go thru all the records and entering the GroupIDs. Your help is much appreciated. Please gimme some ideas.

Payment Help
I'm having problems with my payment calculator. It's not calculating properly. Here is the whole code.

Dim s As Integer
Function pay(payment As String) As String
pay = Val(Mid(payment, 5, 1)) + Val(Mid(payment, 6, 1)) + Val(Mid(payment, 7, 1)) + 100 + Val(pay)
End Function
Sub checknum()
For i = 1 To 10
lstplate.AddItem txtstartplate
If Right(txtstartplate, 3) = "999" Then
txtstartplate = newfunction(Left(txtstartplate, 4)) & " 000"
txtstartplate = Left(txtstartplate, 4) & CStr(Format((Right(txtstartplate, 3) + 1), " 000"))
End If
Next i
End Sub
Function newfunction(plateletters As String) As String
Dim plat, extr, test As String
newfunction = plateletters
plat = "ZZZZ"
extr = "AAA"
y = 4
For x = 1 To 4
If Right(newfunction, y) = plat Then
newfunction = (Left(plateletters, x - 2)) & Chr(Asc(Mid(plateletters, x - 1, 1)) + 1) & extr
Exit For
ElseIf x = 4 And Not (Right(newfunction, y)) = plat Then
newfunction = Left(newfunction, 3) & Chr(Asc(Mid(newfunction, 4, 1)) + 1)
End If
If y > 1 Then
plat = Right(plat, y - 1)
extr = Right(extr, y - 1)
plat = ""
extr = ""
End If
y = y - 1
Next x
'Joy and I made this ourselves
End Function
Private Sub cmdtest_Click()
txtpay = Val(txtpay) + pay(Val(lstplate))
End Sub

Macro: Computing Monthly Returns

I'd like to get monthly returns with a macro, i.e. [soit (B4-B2)/B2, then (B6-B5/B5), etc.] . The manual solution cannot be envisionned as the colums are full.

My datas are disposed like this:

1 Date Amount Monthly return
2 03/03/1997 6
3 17/03/1997 1
4 31/03/1997 7
5 07/04/1997 6
6 21/04/1997 4
7 05/05/1997 1
8 19/05/1997 7
9 02/06/1997 3
10 16/06/1997 6
11 30/06/1997 1
... ...
The following macro may be useful, it permits to get monthly average :

Sub Test()
Dim i%, k%, Resultat As Single, v
Do Until IsDate(Cells(i + 1, 1).Value)
i = i + 1
Do While IsDate(Cells(i + 1, 1).Value)
v = Cells(i + 1, 1).Value
Do While Month(v) = Month(Cells(i + 1, 1).Value)
Resultat = Resultat + Cells(i + 1, 2).Value
i = i + 1
k = k + 1
Cells(i, 3).Value = Resultat / k
Resultat = 0
k = 0
End Sub
Thank you for your help

Monthly Payments Phone Company
Im working on the new soft for this company
and need to know opinions about the logic for inserting payments from clientes in this DB.
The legacy soft used to create month periods for each customer when he was subscribed for the service. So the database could be filled with many months saying false and each time the clients pays it changed to true for that month.
table 1
Clientid Jan/06 feb/06 march/06 ............ for ever
1 True false false ...............

I dont get the idea of creating columns for the periods (month) I think it could be better to fill a single table each time the customer pays inserting in the period column the month that was paid.

table 2
clientID Period
1 dic/05
1 jan/06

The issue here is to get a report with the client's debt. What i was thinknig is just to get the last period the client has paid and through code make a substraction (datediff) with the todays period to get the periods he owns.

I would like to here other experiences with this type of issues.


Loan Amortization - Exact Day Monthly
Most amortization formulas calculate loans based upon the loan being divided into 12 equal periods. From this premise it follows that the monthly interest factor is constant each month. For an annual interest rate of 12% with monthly compounding, the monthly interest factor is .01% each and every month.

I need a formula written in VB that will take into consideration the exact number of days between payments to calculate the monthly interest factor each month, which in turn is used to calculate the interest for that month.

On a $5,000,000 dollar loan for 240 months at 10% interest the conventional amortization method would compute a monthly loan payment of $48,253.08 with a last payment of $48,253.08.

Through trail and error, an "exact day monthly" method would compute a monthly payment of $48,737.08 and a last payment of $48,321.81. This method would take into consideration the variation of days in the month as well as leap years.

Is this possible?

How To Make A Monthly Expences Using Datagrid
 Hi every one! here is my situation i dont know how to compute the values in one column. for example
 my Column0 contains ITEM NAMES and Column1 contains ITEM AMOUNT. since im after for the total amount of the item per week i want to compute the total values of ITEM AMOUNT. please help thank you very much.

Inserting Monthly Information (Solved)
ODBC and Access

I have a database that with client information. I made a VB interface onto it so when we get new clients we can add them to the Access DB. I work for a Union and we have a new process that needs to be added to the form. every moth the union takes out a penny per hour worked. I wanted to add to the form moth/year and amount. Because we contract people some people will have more listings then others. I am having a problem writing the program, when i enter the info what I would like it to do is first verify that the user exists by idenitifying the primary key (social security number), if it does exist add another field to the record. How can I keep adding fields to the records without it having the same name? Is this even feisable?

Thanks for the help


Edited by - epatterson78 on 9/5/2003 4:11:01 PM

Combine Worksheets Into A Monthly Summary
I have several workbooks in one folder. The first sheet in every workbook is named something similar to FB 233 JUN-10-2005. Where 233 could change and the date could change. I would like to be able to combine these sheets into one workbook according to the month they belong in. i.e. FB 233 JUN-10-2005 would go in the JUN.xls workbook, and FB 265 JUL-12-2005 would go into JUL.xls workbook. These workbooks would need to be created and saved to my target path. This code might be ran frequently during the day, and I want to avoid duplicate sheets. i.e. no FB 233 JUN-10-2005(2) sheet put into the JUN.xls workbook. Any duplicates should replace the original sheet in the workbook in case sheet has changes made to it for that day. I am using "C:Documents and SettingsAll UsersDesktopFertilizer Adjustments" as my source path, and "C:Documents and SettingsAll UsersDesktopFertilizer Adjustmentsmonthly" as my target path. If you post some code please let me know what module it goes into. Thanks for any help. I am attaching an example of one of the workbooks that would be in the source file.

Payment Problem
Private Sub CmbPayType_click()
If CmbPayType.Text = "credit card" Then
txtPaid.Text = txtTotal.Text
TxtChange.Text = 0#
End If
End Sub
1) This is a combo box where if the user select credit card as the transaction platform, it will auto display the txtpaid as the total amount and change = 0.

But the problem is no value id displayed at the txt.paid. Is there any way i can improve on the structure of this coding?

If CmbPayType.Text = "Cash" Then
If txtPaid.Text <> "" Then
TxtChange.Text = Val(txtPaid.Text) - Val(txtTotal.Text)
MsgBox "Please enter the amount paid by the customer", vbCritical, "Missing Information"
Cancel = True
End If
End if
2) The coding above show if the user select cash as the transaction platform, it will prompt the user to enter the amount paid and calculate the change by click on the change command.
But the problem is how to prompt the user to enter the amount paid if it is a null, as i try using a if else statement, but it has no effect.

Thanks for reading.

Make Payment Through App??
Hi all,
Just wondering if anyone knows a way to allow you to make a payment through your app? I.e User runs app which has subscription or something along those lines, user then has a form pop up with the fields for name, credit card number etc then when they click process then it makes the payment, maybe through paypal (ideall really) without having IE poping up with the paypal site.

Payment Services
I have just completed writting a program in VB but now I want to try and sell it. Does anyone know of some good payment services I could use so that I can accept credit cards?

Payment Count
I'm having difficulty trying to keep track of a payment function. I don't know what's wrong with it. Can someone help? Here is the code

Function pay(payment As Double) As Double
For s = 1 To 10
temparray(s) = Mid(Val(payment, 1, 1)) + Mid(Val(payment, 2, 1)) + Mid(Val(payment, 3, 1)) + 100
pay = Format(pay + temparray(s), ".00")
Next s
End Function

Then in my go button
txtpayment = pay(lstplates)

Payment Code

I'm currently trying to write a small code for up to 5 employees to calculate gross and net income. I have the main body of the code right, but i have added in a check box for those employees who do not have to pay tax, and whenever i attempt to calculate the pay i get the error;

Compile Error:
Variable required - Can't assign to this variable

This is the code;

VB Code:
Dim Counter As Integer Private Sub cmdCalculate_Click()    Do        lblGross(Counter).Caption = txtPay(Counter).Text * txtHours(Counter).Text        For chkYes(Counter).Value = 1 To 1            lblNet(Counter).Caption = lblGross(Counter)        For chkYes(Counter).Value = 0 To 0            lblNet(Counter).Caption = lblGross(Counter) * (78 / 100)    Counter = Counter + 1    Loop Until Counter = 5    Counter = 0End Sub Private Sub Form_Load()    Counter = 0End Sub

I'm sure that this is a very simple error, but i can't spot it, and any help would be greatly appreciated.



Payment Problem
VB Code:
Private Sub CmbPayType_click()If CmbPayType.Text = "credit card" ThentxtPaid.Text = txtTotal.TextTxtChange.Text = 0#End IfEnd Sub

1) This is a combo box where if the user select credit card as the transaction platform, it will auto display the txtpaid as the total amount and change = 0.

But the problem is no value id displayed at the txt.paid. Is there any way i can improve on the structure of this coding?

VB Code:
Private Sub cmdchange_Click() If CmbPayType.Text = "Cash" Then    If txtPaid = "" Then    MsgBox "Please enter the amount paid by the customer", vbCritical, "Missing Information"    Cancel = True    txtPaid.SetFocus    Else    TxtChange.Text = Val(txtPaid.Text) - Val(txtTotal.Text)    End If    ElseIf CmbPayType.Text = "" ThenMsgBox "Please select the type of payment by the customer", vbCritical, "Missing Information"Cancel = TrueCmbPayType.SetFocusEnd IfEnd Sub

2) The coding above show if the user select cash as the transaction platform, it will prompt the user to enter the amount paid and calculate the change by click on the change command.
But the problem is how to prompt the user to enter the amount paid if it is a null, as i try using a if else statement, but it has no effect.

Thanks for reading.

Make Payment Through App?
Hi all,
Just wondering if anyone knows a way to allow you to make a payment through your app? I.e User runs app which has subscription or something along those lines, user then has a form pop up with the fields for name, credit card number etc then when they click process then it makes the payment, maybe through paypal (ideall really) without having IE poping up with the paypal site.

Payment Function Help
Private Sub cmdCalc_Click()
Dim dblMonthRate As Double
Dim intNumPayments As Integer
Dim dblLoanAmt As Double

dblLoanAmt = Val(txtPrinciple.Text)
intNumPayments = optTerm
dblMonthRate = Val(lstInterest) / 100
lblPayment = Pmt(dblMonthRate / 12, intNumPayments * 12, -dblLoanAmt)

End Sub

I'm attempting to use the payment function on a preformatted form which I'm only required to code. The number of payments range from 2-5 years and are in option button format. I'm not sure how I get the intNumPayments to read the correct information. But I know the code above isn't working.
Anyone understand my question enough to help me?

Subtracting Payment
Hello everyone,

Having a problem when I try and subtract a the following in MS Access:

Previous balance - payment

$10 - ($10) = $20

How can I subtract correctly?

$10 - ($10) should equal $0


Payment Plan
What type of payment plans do you guys use? Which would you think works best for Internet Jobs? (where everything is done via the E-mail). I would think a "Partial Payment Plan" would be recommend, but I just want to hear what other types you use.


Payment Getway
Hi any one has idea how to implement, net teller Payment getway in VB?

Enjoy coding

Generating Monthly Reporting Using Dateadd() Or DateDiff()
Hello everybody out there
i got a problem and stuck with it last 6 or 7 days
but i hav'nt got any further ideas to solve this
plz help me

Dim fdate,str
Set rs1 = New ADODB.Recordset
Sql = "select * from userinfo"
rs1.ActiveConnection = con
rs1.CursorType = adOpenDynamic
rs1.LockType = adLockBatchOptimistic
rs1.Open Sql

fdate = rs1.Fields("OrderDate")
str = DateAdd("M", 1, fdate)
MsgBox fdate & " Date after one month " & str
the above code is running successfully
but what i want is executed this code on click of a button, and automatically generate
ALL the Details of customers whose OrderDate is ">=" 30 days from the
database, and store that date in a variable or in database,
the next time it should count from the date stored in the variable.

First Time the Customer Places an Order:
new_var = OrderDate + 30 days
Second Time:
new_var = new_var + 30 days

I am not getting any further code.....
I certainly wouldn't ask you to do this for me but would be so grateful for you to get me
started in the right direction and appreciate all of your help.

Thanking You in advance


How To Summarize A Weekly And Monthly Sales Report?

ellow to all kind-hearted vb gurus out there...

could you pls give me some code snippet on how to summarize a weekly and monthly sales/inventory reports... im currently using an access database....and im not so familiar about building it on sql statements...

pls reply soon... or im dead...!
thanks guys....!

Running Weekly, Monthly Reports Automatically
Hi all,

I got a little problem.
I have an application that i would like to generate reports on it's own without any user intervention.

I need to be able to have it determine days, weeks and months in calendar format.

for week reports i'll need the app to start every monday and generate a report for the past week. ( monday to sunday)

for the month report. generate report for the past month. ( 1st to last day of month)

Are there any controls or such i may be able to use?

Any suggestions are welcome.

Car Payment Calculation (Any IDEAS Anybody)

I have written a program to calculate a car payment using the following formula:

r = r / 100

P ( r / 12 )
(1 - ( 1 + r / 12 ) ) 'Please ignore the ... before -m

now for the values given (r = 21.75 P = 6400 m = 48) the payment comes out to be $200.77.

But if the first payment date is more than 30 days (for example 31 days meaning 1 day extra) the payment is calculated as $200.89. There is a 0.12 cent difference. And if the days are 32 days (meaning 2 days extra) there a slight increase in the monthly payment.

I want to know how this difference is calculated. How this 0.12 cent difference is being calculated for 1 day extra in the first payment date?

Please HELP, thanks.

Project Help Needed! Up To $100 Payment!
Hi all,

I need someone experienced with VB (or and Excel.

I have an easy project for an experienced coder. The project shouldn't take more than 2 or 3 hrs for an experienced coder.

The project consists of reading data from excel sheet, use the data and display results and a chart...

If you are interested in the project please reply back to this thread with your email address (preferably msn account to chat directly).

I have 48-56 hours to submit this project so you must be flexible with working hours and deliver it as soon as possible.

Payments will be done via PayPal or any payment system you like..



Beginner Needs Help Payment Calculator
i hav a app i need help on. heres what it looks like

its for loans. you type the amount,interest rate then how many years(1-30yrs),then select payments are made monthly or yearly

then when calculate payments is clicked it should say something like this
your yearly(or monthly) payment is $$$$$$
Total amount paid is $$$$$$$$ and total interest paid is $$$$$
heres the form
heres what happens when you type 100,000 for loan, 12 for rate, 30 years, yearly
yearly payment is $12414.37
total amount paid is $372,430.97 and total interest paid is $272,430.97

me and my friend in my vb class have been trying to do this for 2 days now (3 hours of working) and we cant figure it out. thx

Need Help Creating Payment Report... PLEASE HELP!
Hey, how's it goin'?

Well, I'm writing a receipt program for the ISP I work for, and what I'm trying to do is this:

When a customer comes in and pays, we enter in their name, username, how much they paid, and by what method they paid by, ie cash, check, etc.

So, when I click on 'Print receipt', it sends the information we typed in to another form, and prints out. I want to also make a report to show a list of the people who came in on a third form. The 'Print receipt' button sends the data to the third form...


I need to know how to go about doing this... I have created the form, and the list is to be in a frame. I'm not quite sure how to make it put in the customer's name, username, payment amt, and method... I was thinking about using labels, because they print out cleanly on the printer.

Could someone please help me out? To clarify, I need the 'Print receipt' command button to send the information to a third form, which will give a list of all the above information in columns by type.



Payment Processing Application
I have created some mutli-purpose application which includes a database
to store customer records. I need to add some functionality to process
payment such that when a customer pays some money it is reflected
somewhere in the database together with the date and balance due if it
exist. I have 150 records. Does it mean I need to have 150 tables one
for every customer?
Chilangisha B Changwe

-- - Send your email first class

Anyway To Check If Payment Was Made?
Is there anyway to have my program check if a payment was made. Once this information is found it will ad the number of credits to the data file that they ordered (so they would basically be ordering credits to use. So far all i could think of is to have the merchant also send an email to a designated email address and have vb program open it up and extract the email and dollar value then just match it up in my database.. Is there any easyier way to do it?

Payment Application Question
hi all,
i am using vb & ms access database. this is a very simple application. it suppose to keep track of user payments.
for example: user1 is has an outstanding balance of $100. i have no problem with the user when he pays >= the outstanding, basically just calculate the difference and return it to the user. However my problem starts when the user decides to pay less then the outstanding amount how to handle that?
user1 decides to pay the following:
$ 50.00 in Cash
$ 10.00 in Visa
$ 10.00 in M/C
$ 30.00 in Cash (again)
how can i handle this situation? and how to SUM and update the CASH in my database(in my example which is total to $ 80.00) any comments or example on how to do it would be much appreciated

thank you.

Making A Monthly/Yearly Summary Report From Raw Data
Hi Everyone,
I need some help on an excel file I will be creating. The purpose of this file is to input employees' work hours on a weekly basis. Each column is a week for which hours will be inputted.

I have a big list of employees' last names in column A. At the top cell of the other columns (B on) until the end of the sheet, I have the date of Every sunday (since employees report their hours on the Sunday of the work week), which goes on to the year 2011 by the end of the sheet. in this sheet the hours are inputted weekly.

I would like to create 2 other sheets that shows a monthly and yearly summary of the hours of the employees . I don't know how to do that. How can I tell excel to sum, for example, only the values under the dates of a specific month? year?
Thanks, help will be much appreciated.

Newbie Q-combo,payment,lists
hey guys! let's see...what am i trying to do? all right, i'm making a payment calculator (dontcha luv these?) with number of years, interest rate (first and last), interest rate step size, and loan amount. The monthly payments with corresponding interest rates are to be displayed in a list does that even work in a list box where it's supposed to look like this-->
5.00% $149.85
6.00% $152.11
7.00% $154.39
and so on...depending on what the user chooses.
Combo boxes, lists, got would you incorporate looping? I can't quite grasp the concept of looping just yet...would I best use the For...Next structure?

Any words of advice?

Thank you!

Bill Payment Terminal Interface In Vb
i have to cretae an interface for bill payment terminal in visual basic. i would like to know if there r any sites or anybody could help me with the similar code and the flow..this is urgentt..
thanks for any help!!!

VB Code Help For Credit Card Payment Calculator
I know there are probably free ones on the web but I am looking to code a credit card calculator in VB as more practice then anything. The only problem I am having is how to start it.

What I want it to do:

Enter Balance, Interest Rate, Payment Amount, Number of Months and have it spit out how much per month to get the balance to 0. Also trying to get it to actually list the balance per month based on the Payment Amount. It seems really easy and simple but I'm just starting out in VB so it's kinda foreign to me.

Thanks for any help given.

Project Request - Without Payment - Small VB Roulette
I need a small code done - but I can't offer any payment unfortunately. I need this done for a college project and it's really small work for any developer who's in touch with VB regularly etc. I'd do it myself but I haven't done stuff since a long time - in my estimate, it should take any ace about 2 hours to do this. I may, however, offer you web development projects - either in a few weeks or later on a payment basis.

Thus I need some really enthusiastic and free programmers here!

The need is :
Make an activex control that can receive a collection argument. The collection contains items each of which has a name and an associated image (either the fielname or object etc).

When the activex control is assigned this collection of items, it must draw them on the UI in a circle - the circle is a wheel; of fortune. There is a fixed arrow on one side with the arrowhead on the wheel.

Pressing a button on the UI now, will get the activex control to spin the differnt items on the display and then make them stop randomly. After it stops, it raises an event (or somehow communicates to the control client that the spinning has stopped). Then the client should be able to query the activex for the item that is finally positioned under the arrow after the spin.

That's it really. Pls see attached image for an idea of the UI.

This needs to be done by 25th Dec, 03.

Gather Data On A Daily Basis To Make Monthly Analysis :confused:

I receive a file on a dai;ly basis. In this file are inputed data in several columns.
On an other file, a monthly one, i gather all the data from the daily file which are always at the same place on a daily basis:
ie. data 1 will be always stored in cells A2:A20
data 2 will be always stored in G2:G20

I do not know how to gather these data from several files depending on their file named, because their name will depend on the date that i receive them.

Thanks a lot,


Array Calculation... (counting Salary Payment For One Month)
Hello there... need help BADLY for this problem.

I want to know if there is any method that i can use to calculate the total working hours for an

employee for a month based on the punch card.

i have create a form that somewhat look like this;

01 |Textbox | |Textbox | |Textbox | |Textbox | |Textbox |
02 |Textbox | |Textbox | |Textbox | |Textbox | |Textbox |
03 |Textbox | |Textbox | |Textbox | |Textbox | |Textbox |
31 |Textbox | |Textbox | |Textbox | |Textbox | |Textbox |

The first column is for punch-in in the morning, second is for punch-out for lunch, third is for

punch-in after lunch and fourth column is for punch-out.

The thing is, i create this textboxes using ARRAY, by mean that the second-column-
second-row is started with Textbox1, second-column-third-row is Textbox1(1) and so on... the same

thing is also applied for the rest of the column.

Because the input is keyed-in based from the punch card, how can i calculate the total hour for every

day??? let say on 03 on this month, i was absent, so there is no need to key in anything on that

particular date.

the other situation is like this...

to get the total hour for that day, several terms and condition has to be fulfilled; and that is...

1) the default time in is 9:00am, anyone who comes before that time, it will not be counted the counting started only at 9:00am. anyone who come after 9:15am, their salary will be deducted for every minute they late ($5 perHour and the deduction only occurs on 9:16 and afterwards)

2) if their total lunch hour break is less than 1 hour(this amount will be deducted from the total hour, lets say that i'm working for 8 hours per day, only 7 hours is counted in.), it will still be counted as 1 hour and if it exceeds 1 hour, the salary will be deducted for every minute they late for punch in.

3) the default punch-out time is 6:00pm. if they punch out before 5:45pm, their salary will be deducted will be deducted. but if they punch out on 5:45 and afterwards, they will be paid full one hour.

at the end, there will be two labels that display two different total time for the whole month. one

is WITHOUT the break time (the total salary payment will be counted based on this total).

and the other one will display the grand total of working hours together with the lunch break.

i hope that i've describe my problem clear enough for anyones understanding.

I REALLY REALLY need help on this thing. can anyone out there help me with with this problem?

i REALLY appreciate your help and a Billion thanks for being my saviour...

Formula For Interest Portion Of A Payment For A CANADIAN MORTGAGE (semi-annually)
I know about VB's functions to calculate mortgage payments. However they do not apply to Canadian mortgages which are compounded semi-annually as opposed to monthly.

I can calculate mortgage payments.
However in order to create amortization table, I also need to calculate interest portion of a mortgage payment for a CANADIAN MORTGAGE (compounded semi-annually).

What is the formula?

Payment Step-by-step Form
This I think is going to be difficult. I have a tutorial that I am trying to figure out on how to do this but it is basic. It can be seen here

Anyways, I have a form that I want to use for employee pay. 1. I want to select (from dropdown) the employee position (employeeInfotbl).

2.This brings up the employee names (employeeInfotbl) that hold this position. (from dropdown) and the employee is selected from here.

3. This then shows if that employee is on Wage or Salary (employeeInfotbl). If it is wage then 2 boxes come up, one with their hrly $ and one for how many hours they worked. Depending on which one he/she is on, the final amount will be added to an expense report I have as Fixed Exp. or Variable Exp.

4. Next I have date range txt boxes with calendars to choose the time the payment covers.

5. Next dropdown boxes with employee Metrics (their performance records) (employeemetricperformancetbl) for that time period show up and can be selected. Along with this is a text box for the "goal" to be set. i.e. if the boss says reach 10, that number goes in this text box. The Metric is selected and the form automatically sees if it is < or > 10. If it is, then an amount is added to their hourly wage.

6. After all this is filled in, another date box comes up so the payment amount can be put in the expense records for that date.

Anyways, I don't really have an idea of how to do this. I know I need to build the comboboxes w/o the wizard, and there needs to be queries behind each one. I just don't knwo how to get it to work with different tables. I am sure more explanation is needed so just ask if there is confusion.
Thanks all!

Monthly Sales Summary Of &"Anup-Sales&" ...
Dear Friends,

I have forgotten one more thing in my project to add. The project has the monthly total sales in Form2. In the same way I need the monthly total sales of individual sales person monthwise (Like monthly sales summary of "ANUP-SALES", monthly sales summary of "RAJ-SALES" & monthly sales summary of " RAVI-SALES. I have added one more form i.e. Form 4. So I need help to get the monthly sales for each month for sales person "ANUP". If I get this code I can add 2 more forms for "Raj" & "Ravi" and I can use the same code modifying to suit them.

I tried a lot and failed to do so. Hence I am seeking help of Forum.

Thanks in advance.


Am I Calculating FPS Right?
Here's the code:

Before the game loop:

' Used for calculating fps
TickFPS = GetTickCount
FPS = 0
At the beginning of the game loop:

Tick = GetTickCount
At the end of the loop:

'Lock FPS
Do While GetTickCount < Tick + 20

' Calculate fps
If GetTickCount > TickFPS + 1000 Then
TickFPS = GetTickCount
FPS = 0
FPS = FPS + 1
End If

Call DrawSurfaceText("FPS: " & GameFPS, 200, 2)
The code for the GetTickCount function:

Public Declare Function GetTickCount Lib "kernel32" () As Long
Am I calculating the FPS right?

For some reason it's locked at 49 on my slow computer, but on fast computers it seems to be locked at 32... Any idea why?

Calculating Tax
Hello guys i;ve created windows application form for a service station, and i have little problem finising the program.I could not calculate the tax rate and number of gallons that a user put in.

public Class Form1
Dim price As Single

Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim subtotal As Single
subtotal = 0
subtotal = price
Dim txtNumberGallons As Double
txtNumberGallons = txtNumberGallons * price
Dim txtTaxRate As Double = 0.06
txtTaxRate = txtTaxRate * price

If chkOil.Checked = True Then
subtotal = subtotal + 2.35

End If
If chkWindSheildWipers.Checked = True Then
subtotal = subtotal + 12.0

End If
If chkWindSheildFluid.Checked = True Then
subtotal = subtotal + 1.56

End If
If chkCoolant.Checked = True Then
subtotal = subtotal + 1.26

End If
txtTotal.Text = subtotal.ToString("$##,##0.00")
End Sub

This code works fine but is not adding the tax for purchase or the number of gallons of gas

example if a gallon of gas price is $ 2.95 and a person puts in 5 is $ 14.95 but when i hit calculate it just returning $ 2.95 please i need your guys thanks.
Edit by moderator: Please use [vb][/vb] tags for posting code.
I've also moved this to our .NET section as opposed to legacy VB.

Im not sure if this is in the right place and i did search but did'nt find exactly what i was looking for.

I have a number of text boxes which allow a 2 digit number to be typed in. This number is the quantity of stock. Now when a button (lets call it cmdCalc) is clicked, i want it to show the total price in a label.

For example

12 desks at $100 each
3 chairs at $33 each
1 pen at $1.55 each

Total should be $1300.55 (i think...hehehe)

How do i get it to calculate this the moment im using a line of code for every object...each

if len(txtdesk.text) > 0 then
lbltotal.caption = lbltotal.caption + val(txtdesk.text) * 100
end if

wat am i doing wrong?

Calculating Age
i have a variable dateofbirth which is a date, is there anyway i can use this to work out a current age(in whole years)?

Copyright 2005-08, All rights reserved