Home All Groups Group Topic Archive Search About

"Can't use parentheses when calling a Sub" help......

Author
6 May 2006 5:29 PM
zheetee
<script type="text/vbscript">
        sub setTextBoxValue(a1,a2)
            thedelete.deleteTextBox.value = a1

        end sub
    </script>

                        <td>
                            <a href="#"
onclick="setTextBoxValue('<%#Container.DataItem("SerialNumber")%>','<%#Container.DataItem("EquipmentCategory")%>')">
<%#Container.DataItem("SerialNumber")%> </a>
                        </td>


when i click on <%#Container.DataItem("EquipmentCategory")%>')
then it will call sub setTextBoxValue(a1,a2) function

but it return "Can't use parentheses when calling a Sub"
may i know what is the problem??
i can create a function that more than 1 variable??
or my database connection or variable got problem??
help...

Author
7 May 2006 4:35 AM
Ken Cox - Microsoft MVP
What about turning the sub into a function?

    <script type="text/vbscript">
        function setTextBoxValue(a1,a2)
            thedelete.deleteTextBox.value = a1
        end function
    </script>

<zhee***@gmail.com> wrote in message
Show quoteHide quote
news:1146936572.093866.32250@i39g2000cwa.googlegroups.com...
>
>    <script type="text/vbscript">
>        sub setTextBoxValue(a1,a2)
>            thedelete.deleteTextBox.value = a1
>
>        end sub
>    </script>
>
>                        <td>
>                            <a href="#"
> onclick="setTextBoxValue('<%#Container.DataItem("SerialNumber")%>','<%#Container.DataItem("EquipmentCategory")%>')">
> <%#Container.DataItem("SerialNumber")%> </a>
>                        </td>
>
>
> when i click on <%#Container.DataItem("EquipmentCategory")%>')
> then it will call sub setTextBoxValue(a1,a2) function
>
> but it return "Can't use parentheses when calling a Sub"
> may i know what is the problem??
> i can create a function that more than 1 variable??
> or my database connection or variable got problem??
> help...
>
Are all your drivers up to date? click for free checkup

Author
7 May 2006 7:37 AM
zheetee
after i change to function...

still having same problem.... :(
Author
17 May 2006 4:44 PM
Jeff Dillon
Rewrite your code and post it here so that it doesn't use any database
calls, so we can run and test it.

Jeff
<zhee***@gmail.com> wrote in message
Show quoteHide quote
news:1146987469.235728.314310@e56g2000cwe.googlegroups.com...
> after i change to function...
>
> still having same problem.... :(
>

Bookmark and Share