473,320 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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


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

end sub
</script>

<td>
<a href="#"
onclick="setTextBoxValue('<%#Container.DataItem("S erialNumber")%>','<%#Container.DataItem("Equipment Category")%>')">
<%#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...

May 6 '06 #1
7 5215
JT
This may not apply here, but in straight ASP (not ASP.NET), if you have
a function such as GimmeWhatIWant(Bribes, Groupies), then in your code
you need to call it with the following statement:

call GimmeWhatIWant(500.00, "Suzie")

If you don't include the word "call " then you will get that
"parentheses" error. Again, that may not be applicable here, but I
hope that helps.

May 6 '06 #2
Does it work if you do as it says and remove the brackets?

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

http://msdn.microsoft.com/library/de...499137b3f7.asp

"To call a Sub procedure from another procedure, type the name of the
procedure along with values for any required arguments, each separated by a
comma. The Call statement is not required, but if you do use it, you must
enclose any arguments in parentheses.

The following example shows two calls to the MyProc procedure. One uses the
Call statement in the code; the other doesn't. Both do exactly the same
thing. "

Call MyProc(firstarg, secondarg)

MyProc firstarg, secondarg


<zh*****@gmail.com> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...

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

end sub
</script>

<td>
<a href="#"
onclick="setTextBoxValue('<%#Container.DataItem("S erialNumber")%>','<%#Container.DataItem("Equipment Category")%>')">
<%#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...

May 6 '06 #3
if i put like this...
<a href="#" onclick=Call
"setTextBoxValue('<%#Container.DataItem("SerialNum ber")%>')">
<%#Container.DataItem("SerialNumber")%> </a>

return error msg:syntax error

May 7 '06 #4
What about turning the sub into a function?

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

<zh*****@gmail.com> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...

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

end sub
</script>

<td>
<a href="#"
onclick="setTextBoxValue('<%#Container.DataItem("S erialNumber")%>','<%#Container.DataItem("Equipment Category")%>')">
<%#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...

May 7 '06 #5
after i change to function...

still having same problem.... :(

May 7 '06 #6
You have to put all the code inside the onclick property.

<a href="#" onclick="Call
setTextBoxValue('<%#Container.DataItem("SerialNumb er")%>')">

or if you use the syntax without paranteses:

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

Why are you using VBScript for the client code anyway? You are aware
that it only works in Internet Explorer and no other browsers?

zh*****@gmail.com wrote:
if i put like this...
<a href="#" onclick=Call
"setTextBoxValue('<%#Container.DataItem("SerialNum ber")%>')">
<%#Container.DataItem("SerialNumber")%> </a>

return error msg:syntax error

May 7 '06 #7
Rewrite your code and post it here so that it doesn't use any database
calls, so we can run and test it.

Jeff
<zh*****@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
after i change to function...

still having same problem.... :(

May 17 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Geert-Pieter Hof | last post by:
Hello, I have written an application in Visual Basic 6.0 Professional SP5 that reads data from an Excel workbook by using ADO. When I close the application, I get the error: 'The instruction...
119
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see,...
1
by: fang | last post by:
Really confusing, I am using visual stdio C++ 6.0 I add a new project file into my current workspace. If I use the default output directory like default and release, everything works fine. But...
2
by: Steve Holden | last post by:
I'm trying to copy data from an Access database to PostgreSQL, as the latter now appears to work well in the Windows environment. However I'm having trouble with date columns. The PostgreSQL...
3
by: Reney | last post by:
I am using Access Database in my program. The column in the table that I am going to use has date/time value with Medium Time selected. (HH:mm). The program is recording a clock in time to this...
2
by: loga123 | last post by:
Hi All, I am new to .net. I am creating a text box in a "button1" "click event" dynamically based on user input. Name of the text box and ID of the text box contro are set dynamically in the...
2
by: GreggaR0und | last post by:
Hello; I am doing some data validation within InfoPath. One of my forms uses VBscript, not JScript, but I'm hoping this is still the best forum to post my issue. When I use the ReportError...
4
by: =?Utf-8?B?Qm9iIEgu?= | last post by:
I'm trying to execute selectsinglenode(string_var) where where string_var contains the value ".//NetIncome(YTD)_Member/Series". The opening and closing parentheses are literals (not defining a...
4
by: jorgejch | last post by:
Hello, I've started with python (3) recently. Initialy only for scripting. Now I'm trying the object oriented bit. I'm getting the following error message <Atom.Atom object at 0x7f0b09597fd0>...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.