Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong number of arguments 1

Status
Not open for further replies.

peljo

Technical User
Mar 3, 2006
91
0
0
BG
Can you help me? I get the error wrong type of arguments in my function as follows
Private Sub Command0_Click()
Call ANewDBWithPass("c:\BE\Lest", "secret")
End Sub

Function ANewDBWithPass(ByVal tName As String) '// adds the current date to the name of the database
Dim wsp As Workspace
Dim db2 As Database
Set wsp = DBEngine.Workspaces(0)
If Right(tName, 4) = ".mdb" Then
' Remove .mdb from the name
tName = Left(tName, Len(tName) - 4)
End If
' Add date and extension
tName = tName & Format(Date, "dd-mm-yyyy") & ".mdb"
' Create database
',Set db2 = wsp.CreateDatabase(tName, dbLangGeneral)
Set db2 = wsp.CreateDatabase(tName, dbLangGeneral & ";pwd=" & strPassword)
db2.Close
End Function
 
Function ANewDBWithPass(ByVal tName As String[!], strPassword As String[/!])

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks ! Thank you so much !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top