i got the function below to execute an update command (access db), i got a runtime error 13 when i call the function but the the update is running in the database....any help why i got the error...


Code:
Public Function ExecuteSQLa(ByVal strSql As String, Optional ByRef RowsAffected As Long) As ADODB.Recordset
Dim cmd As ADODB.Command
lngRowsAffected = 0
  On Error Resume Next 'GoTo ExecuteSQLa_Error

  Set cmd = New ADODB.Command
  cmd.ActiveConnection = AccCon
  cmd.CommandText = strSql
  Set ExecuteSQLa = cmd.Execute(RowsAffected)
  lngRowsAffected = RowsAffected
  Set cmd = Nothing

   On Error GoTo 0
   Exit Function
ExecuteSQLa_Error:
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure ExecuteSQLa of Module modMain"
End Function