Newbie needs help with Loop to textBox 
Author Message
 Newbie needs help with Loop to textBox

I need help displaying the output from a looped procedure to a
multilined textbox.  I have written the following amortization schedule
(don't laugh, it's part of my first real program), and can get it to
print to a picture box but cannot figure out how to make it display
entirely to a textbox:'amortization Schedule

Let month = 1
Let numMonths = years * 12

Let prinPaid = PPmt(monthlyRate, month, numMonths, loanAmt)
Let intPaid = IPmt(monthlyRate, month, numMonths, loanAmt)
Let Balance = loanAmt - (-prinPaid)
picResult.Print month, -prinPaid, -intPaid, Balance

Do
    Let month = month + 1
    Let prinPaid = PPmt(monthlyRate, month, numMonths, loanAmt)
    Let intPaid = IPmt(monthlyRate, month, numMonths, loanAmt)
    Let Balance = Balance - (-prinPaid)
    picResult.Print month, -prinPaid, -intPaid, Balance
Loop Until month >= numMonths

Any suggestions on how I could change the code to make this work.  You
would not begin to imagine how much this is appreciated!!!
Holly

Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.



Tue, 13 Nov 2001 03:00:00 GMT  
 Newbie needs help with Loop to textBox

Quote:

> I need help displaying the output from a looped procedure to a
> multilined textbox.  I have written the following amortization
schedule
> (don't laugh, it's part of my first real program), and can get it to
> print to a picture box but cannot figure out how to make it display
> entirely to a textbox:'amortization Schedule

> Let month = 1
> Let numMonths = years * 12

> Let prinPaid = PPmt(monthlyRate, month, numMonths, loanAmt)
> Let intPaid = IPmt(monthlyRate, month, numMonths, loanAmt)
> Let Balance = loanAmt - (-prinPaid)
> picResult.Print month, -prinPaid, -intPaid, Balance

> Do
>     Let month = month + 1
>     Let prinPaid = PPmt(monthlyRate, month, numMonths, loanAmt)
>     Let intPaid = IPmt(monthlyRate, month, numMonths, loanAmt)
>     Let Balance = Balance - (-prinPaid)
>     picResult.Print month, -prinPaid, -intPaid, Balance
> Loop Until month >= numMonths

> Any suggestions on how I could change the code to make this work.  You
> would not begin to imagine how much this is appreciated!!!
> Holly

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

As you said, your text box must be set to multi-line.  Then, when you
want to start a new line, add a "VbCrLf" to the end of your string.  For
Example, the following code:

Text1.Text = "A" & VbCrLf & "BC" & VbCrLf & "D"

Produces a text box that looks like this:

A
BC
D

Happy to help

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Tue, 13 Nov 2001 03:00:00 GMT  
 Newbie needs help with Loop to textBox
Holly,

Instead of printing to a picturebox with this line of code:

        picResult.Print month, -prinPaid, -intPaid, Balance

try adding the data to a textbox, with a tab between each piece of data and
a carriage return at the end of the line:

        txtResult.Text = txtResult.Text & month & vbTab & prinPaid & vbTab &
intPaid & Balance & vbCrLf

Hope this helps,

Kerry Moorman


Quote:
> I need help displaying the output from a looped procedure to a
> multilined textbox.  I have written the following amortization schedule
> (don't laugh, it's part of my first real program), and can get it to
> print to a picture box but cannot figure out how to make it display
> entirely to a textbox:'amortization Schedule

> Let month = 1
> Let numMonths = years * 12

> Let prinPaid = PPmt(monthlyRate, month, numMonths, loanAmt)
> Let intPaid = IPmt(monthlyRate, month, numMonths, loanAmt)
> Let Balance = loanAmt - (-prinPaid)
> picResult.Print month, -prinPaid, -intPaid, Balance

> Do
>     Let month = month + 1
>     Let prinPaid = PPmt(monthlyRate, month, numMonths, loanAmt)
>     Let intPaid = IPmt(monthlyRate, month, numMonths, loanAmt)
>     Let Balance = Balance - (-prinPaid)
>     picResult.Print month, -prinPaid, -intPaid, Balance
> Loop Until month >= numMonths

> Any suggestions on how I could change the code to make this work.  You
> would not begin to imagine how much this is appreciated!!!
> Holly

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.



Tue, 13 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Newbie needs help with recursive loops.....

2. NEWBIE need urgent help! Split in for-loops

3. NEWBIE HELP - Do-loop while loop

4. Newbie Needs Help on Textbox

5. Newbie needs help with TextBox

6. Help Newbie Looping through recordset

7. HELP Newbie question about looping through recordests

8. newbie help! do while loop: if query = empty

9. Need Report to look at SQL Data source ( VB / CR newbie needs help)

10. Help! Need help with TextBox Cntrl

11. Newbie Help ...Adding TextBoxes At RunTime

12. VB4 newbie help: Reading a real into a textbox

 

 
Powered by phpBB® Forum Software