i get the error "wrong number of arguments or invalid proprty assignment"
Can you help me with this problem ?
Private Function KillObject(strDbName As String, acObjectType As Long, strObjectName As String, StrPassword As String)
StrPassword = "secret"
Dim db As DAO.Database
Dim adb As Object
Set adb = CreateObject("Access.Application")
adb.OpenCurrentDatabase strDbName, , StrPassword
adb.DoCmd.DeleteObject acObjectType, strObjectName
adb.CloseCurrentDatabase
Set adb = Nothing
End Function
Private Sub Command2_Click()
Call KillObject(GPath, 0, "products", "secret")
Can you help me with this problem ?
Private Function KillObject(strDbName As String, acObjectType As Long, strObjectName As String, StrPassword As String)
StrPassword = "secret"
Dim db As DAO.Database
Dim adb As Object
Set adb = CreateObject("Access.Application")
adb.OpenCurrentDatabase strDbName, , StrPassword
adb.DoCmd.DeleteObject acObjectType, strObjectName
adb.CloseCurrentDatabase
Set adb = Nothing
End Function
Private Sub Command2_Click()
Call KillObject(GPath, 0, "products", "secret")