Calling A Function (What am I doing wrong) 
Author Message
 Calling A Function (What am I doing wrong)

Ok, I just put a module in to check to see if a table exists.  Now, in my
code I want to call the function.... but I can't get my call statement
correct.  It keeps giving me errors no matter what I change it to....  My
function is declared as follows:

Function fExistTable(strTableName As String) As Integer

Shouldn't I call it by saying:

Call fexisttable(strtablename)    ????

Thanks!



Sun, 18 May 2003 03:00:00 GMT  
 Calling A Function (What am I doing wrong)

iReturn = fexisttable(strtablename)

Or how about:

if fexisttable(strtablename) = iThere then
   'Do stuff that depends on the table being there
else
   'do stuff for when the table is not there.
endif

Either way, you probably also meant to define the function as a boolean.
Also make sure your scope is correct.  If the calling procedure is in
another module or form, declare it as a public.



Quote:
> Ok, I just put a module in to check to see if a table exists.  Now, in
my
> code I want to call the function.... but I can't get my call statement
> correct.  It keeps giving me errors no matter what I change it to....
My
> function is declared as follows:

> Function fExistTable(strTableName As String) As Integer

> Shouldn't I call it by saying:

> Call fexisttable(strtablename)    ????

> Thanks!

Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 18 May 2003 03:00:00 GMT  
 Calling A Function (What am I doing wrong)
um - it is a function.

dim intRetVal as Integer

intRetVal = fexisstable(strtablename)

--Al

Quote:
> Ok, I just put a module in to check to see if a table exists.  Now, in my
> code I want to call the function.... but I can't get my call statement
> correct.  It keeps giving me errors no matter what I change it to....  My
> function is declared as follows:

> Function fExistTable(strTableName As String) As Integer

> Shouldn't I call it by saying:

> Call fexisttable(strtablename)    ????

> Thanks!



Sun, 18 May 2003 03:00:00 GMT  
 Calling A Function (What am I doing wrong)
The function fExistTable is going to return an integer.
So here's how you should do this:

    Dim iRet as Integer
    iRet = fExistTable(strTableName)

--
Paul Benner


Quote:
> Ok, I just put a module in to check to see if a table exists.  Now, in my
> code I want to call the function.... but I can't get my call statement
> correct.  It keeps giving me errors no matter what I change it to....  My
> function is declared as follows:

> Function fExistTable(strTableName As String) As Integer

> Shouldn't I call it by saying:

> Call fexisttable(strtablename)    ????

> Thanks!



Sun, 18 May 2003 03:00:00 GMT  
 Calling A Function (What am I doing wrong)
Duh.... thanks guys!

Roxanne


Quote:
> Ok, I just put a module in to check to see if a table exists.  Now, in my
> code I want to call the function.... but I can't get my call statement
> correct.  It keeps giving me errors no matter what I change it to....  My
> function is declared as follows:

> Function fExistTable(strTableName As String) As Integer

> Shouldn't I call it by saying:

> Call fexisttable(strtablename)    ????

> Thanks!



Mon, 19 May 2003 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. BAD DLL calling conventions - What am I doing wrong

2. Recordset: What am I doing wrong?

3. What am I doing wrong??

4. What am I doing wrong?

5. Help with syntax. What am I doing wrong

6. What am I doing wrong?

7. What am I doing wrong?

8. What am I doing wrong?

9. Please tell me what I am doing wrong - DAO parameter Append Query :(

10. What am I doing wrong? -MultiSelect List box

11. Select Case - What am I doing wrong?

12. What am I doing wrong (easy).

 

 
Powered by phpBB® Forum Software