Neal Kling
nkling at co.montgomery.ny.us
Mon Jun 13 07:52:02 CDT 2005
I see you're setting the table variable right in the function. But the function it's self is still expecting you to pass a table name. I suspect this may be where you are having a problem. Either redeclare the function without the strTableName parameter, or pass it the table name. In other words instead of setting strTableName in the function, call the function like this:
DeleteTableLink "tblDebiteurAlgemeen"
Don't forget to comment out the line
strTableName = "tblDebiteurAlgemeen"
Neal
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Pedro Janssen
Sent: Sunday, June 12, 2005 5:51 PM
To: AccessD at databaseadvisors.com
Subject: [AccessD] invalid number of arguments
Hello Group,
i am using a function that Neil Kling provided me in the past.
When running it from an expression i get an error:
Invalid number of arguments.
Who can help me with this
Pedro Janssen
Function DeleteTableLink(strTableName As String) As Boolean
On Error GoTo Err_DeleteTableLink
Dim db As Database
strTableName = "tblDebiteurAlgemeen"
Set db = DBEngine(0)(0)
db.TableDefs.Delete strTableName
db.TableDefs.Refresh
DeleteTableLink = True
Exit_DeleteTableLink:
Exit Function
Err_DeleteTableLink:
Select Case Err
Case 0 'insert Errors you wish to ignore here
Resume Next
Case 3265 'Item doesn't exist in collection
Resume Next
Case Else 'All other errors will trap
Beep
MsgBox Err.Number & "; " & Err.Description, , "Error in function basObjectHandlers.DeleteTableLink"
Resume Exit_DeleteTableLink
End Select
Resume 0 'FOR TROUBLESHOOTING
End Function
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com