View Full Version : How to call function

Squall Leonhart
12-03-2003, 07:22 PM
Hi, guys.

I want to ask you how to call function.
Please take a look at code.

Sub A1_OnClick
call whatever()
End Sub
<title>Create Excel on Server</title>
<body bgcolor="#FFFFFF">
<!--#Include file="functions.inc"-->


Clicking button will call the function in functions.inc file

Function whatever()
'Name of the access db being queried
End function

But when I clicked the button, it says error message.
Type mismatch 'whatever'
But I checked spelling, nothing is wrong as you can see.
Can you guys see the problem? Thank you.

Roy Sinclair
12-03-2003, 08:45 PM
Your include file is SERVER SIDE code and will only be available to functions run while the page is being processed by the server while your calling function is CLIENT SIDE which is only run AFTER the server has already finished processing the page.

You must remember that SERVER SIDE code runs first and will always be 100% completely finished before any of the CLIENT SIDE code starts to execute. Calls from one to the other are not possible.