kingnothingz
Registered User.
- Local time
- Today, 13:33
- Joined
- Feb 14, 2009
- Messages
- 24
Hi All,
I'm trying to create a function that insets into a table. The idea is to use this function to create an entry in table tblBackupLog. I intent to use this to backup the database, and add an entry into the table.
Everytime, i run this, i get this error message.
Error 3061 (Too few parameters. Expected 3) in procedure addBackupLog of Module modBackup
what am i doing wrong?Any help will be appreciated.
I'm trying to create a function that insets into a table. The idea is to use this function to create an entry in table tblBackupLog. I intent to use this to backup the database, and add an entry into the table.
Code:
Public Function addBackupLog(strAction As String, strComments As String, strFileName As String) As Variant
Dim db As DAO.Database
Dim strSQL As String
On Error GoTo addBackupLog_Error
Set db = CurrentDb()
strSQL = "INSERT INTO tblBackupLog ( dateOfAction, [Action], Comments, FileName, userName, computerName ) SELECT Now() AS Expr1, strAction AS Expr2, strComment AS Expr3, strFileName AS Expr4, getUserName() AS Expr5, getComputerName() AS Expr6;"
Debug.Print strSQL
db.Execute strSQL, dbFailOnError
db.Close
On Error GoTo 0
Exit Function
addBackupLog_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure addBackupLog of Module modBackup"
End Function
Error 3061 (Too few parameters. Expected 3) in procedure addBackupLog of Module modBackup
what am i doing wrong?Any help will be appreciated.