Need help reformatting...

T

TN Bella

This may be a double post...
I appreciate all the help I have gotten on here - thank you! So with
that in mind, I figured I would try another post! :)

I need to reformat the following information like this:

txtacctnum txtcostcntr txtrefnum txtacctamt
txtacctnum1 txtcostcntr1 txtrefnum1 txtacctamt1
txtacctnum2 txtcostcntr2 txtrefnum2 txtacctamt2

Currently it is like this:
txtacctnum
txtacctnum1
txtacctnum2

txtcostcntr
txtcostcntr1
txtcostcntr2







Dim index As Integer

litResponse.text += "<b>Account Number</b>: "
& txtacctnum.Text.ToUpper & "<br>" 'First output for first "txtAcctNum"
box then goes to loop
For index = 1 To 14
If CType(Me.FindControl("txtAcctNum" &
index.ToString()), TextBox).Text <> "" Then 'Condition to check for null
strings & to stop it from displaying.
litResponse.Text += "<b>Account number " &
index & " : </b>" & _
CType(Me.FindControl("txtAcctNum" & index),
TextBox).Text & "<br>"
End If
Next index
litResponse.Text +="<br>"


'The first txtCostCntr can be null if
txtAcctNum = 9
If txtCostCntr.Text<>"" Then
litResponse.text += "<b>Cost Center</b>:
" & txtCostCntr.Text.ToUpper & "<br>"
Else
litResponse.text += "<br>"
End If


For index = 1 To 14
If CType(Me.FindControl("txtCostCntr" &
index.ToString()), TextBox).Text <> "" Then 'Condition to check for null
strings & to stop it from displaying.
litResponse.Text += "<b>Cost center " &
index & " : </b>" & _
CType(Me.FindControl("txtCostCntr" & index),
TextBox).Text & "<br>"
End If
Next index
litResponse.Text +="<br>"

'The first txtRefNum can be null
If txtRefNum.Text<>"" Then
litResponse.text += "<b>Reference
Number</b>: " & txtRefNum.Text.ToUpper & "<br>"
Else
litResponse.text += "<br>"
End If


For index = 1 To 14
If CType(Me.FindControl("txtRefNum" &
index.ToString()), TextBox).Text <> "" Then 'Condition to check for null
strings & to stop it from displaying.
litResponse.Text += "<b>Reference Number "
& index & " : </b>" & _
CType(Me.FindControl("txtRefNum" & index),
TextBox).Text & "<br>"
End If
Next index
litResponse.Text +="<br>"

'litResponse.text += "<b>Account Amount</b>: $"
& txtAcctAmt.Text & "<br>" 'First output for first "txtAcctAmt" box then
goes to loop
Dim DollarText2 as double
Dim TxtBoxVal as string

DollarText2 = Convert.ToDouble(txtAcctAmt.Text)
TxtBoxVal = DollarText2.ToString("C")

'litResponse.text += "<b>Account Amount</b>:
" & txtAcctAmt.Text & "<br>" 'First output for first "txtAcctAmt" box
then goes for loop

litResponse.text += "<b>Account Amount</b>:
" & TxtBoxVal & "<br>" 'First output for first "txtAcctAmt" box then go
for loop

For index = 1 To 14
If CType(Me.FindControl("txtAcctAmt" &
index.ToString()), TextBox).Text <> "" Then 'Condition to check for null
strings & to stop it from displaying.
''''''''''''''
'code to display txtAcctAmt as Dollar
amount

TxtBoxVal =
CType(Me.FindControl("txtAcctAmt" & index.ToString()), TextBox).Text

if (len(TxtBoxVal) > 0) then
DollarText2 =
Convert.ToDouble(TxtBoxVal)
TxtBoxVal = DollarText2.ToString("C")
end if

''''''''''''
litResponse.Text += "<b>Account Amount " &
index & " : </b>" & TxtBoxVal & "<BR>"

End If
Next index
litResponse.Text +="<br>"

litResponse.text+="<b>Account Amount
Total</b>: " & txtAcctAmtSum.text & "<br>"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top