Forums
This topic is locked
Formatting a 'sub'
30 Sep 2001 14:37:20 jon badda posted:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Before the Repeat Region you need to declare a variable and set it's value to zero.
<%
DIM myTotal
myTotal = 0
%>
And then IN the Repeat Region you should write the following code:
<% myTotal = myTotal + rsName.Item.Fields(myField).Value %>
And then in the table cell where you want to place the total
<% =myTotal %>
That should do the job.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
I found the answer to the question below and it worked good BUT i really need to format it as a currency number.
im getting the same basic error about not being able to paranthesis a 'sub' but cant seem to make it go away.
This is what a formatted record looks like...
<%= FormatCurrency((rsWhole.Fields.Item("productPrice".Value), -1, -2, -2, -2)
%>
and i want the <% =myTotal %> to be formatted similarly.
Any help would be great, thanks.
Replies
Replied 30 Sep 2001 18:15:53
30 Sep 2001 18:15:53 Owen Eastwick replied:
Have you tried:
<%= FormatCurrency(myTotal, -1, -2, -2, -2)%>
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
<%= FormatCurrency(myTotal, -1, -2, -2, -2)%>
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 01 Oct 2001 13:53:13
01 Oct 2001 13:53:13 jon badda replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Have you tried:
<%= FormatCurrency(myTotal, -1, -2, -2, -2)%>
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
absolutely marvellous.
I had played around with various incarnations of that...but I can see what i was doing wrong now.
thanks alot.
Have you tried:
<%= FormatCurrency(myTotal, -1, -2, -2, -2)%>
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
absolutely marvellous.
I had played around with various incarnations of that...but I can see what i was doing wrong now.
thanks alot.