Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
field =total loan repayment- field=fortnight installments
i want to enter fortnight installments from a text box to subtract from total loan repayment.
thankyou

What I have tried:

private sub text60_enter()
dim total loan repayment as integer
dim fortnight installment value(txt.val)
total loan repayment-(value.txtbox.0)=total loan repayment
Posted
Updated 30-Aug-21 17:33pm
v2
Comments
Maciej Los 31-Aug-21 1:49am    
VBA or JavaScript? The question is tagged with JavaScript, but in the title VBA is used. Which one is correct?

Where from [total loan repayment] comes?

1 solution

The code you posted contains many problems so it's hard to know what are the elements (variables or UI objects) you try to use.

First of all, you cannot use spaces in names. Space separates names etc so this would lead to errors in compiling.

Then about variable declaration, first you define the name then the data type. Have a look at Declaring variables (VBA) | Microsoft Docs[^]

About the calculation, in an assignment, the variable you're assigning to is on the left side and the calculation is on the right side. Have a look at Writing assignment statements (VBA) | Microsoft Docs[^]

These should help you to rewrite the code so that it's closer to desired functionality.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900