help with error message

message from David on 25 May 2004
I have this simple piece of code that works just fine, but when it is
Run-time error '2495':

The action or method requires a Table Name argument
***********
I think that the error occurs in calling the Sub, which I do from a
function. Running just the sub alone I don't seem to get the error.

Code:
=====================================================
Function GetReleases()
NewKits
End Function

Sub NewKits()
Dim RelNum

DoCmd.SetWarnings False
DoCmd.RunMacro "mroNewReleaseFinal"
DoCmd.OpenTable "tblNewReleasesFinal"

RelNum = DCount("*", "tblNewReleasesFinal")

If RelNum = 0 Then

DoCmd.Close acTable, "tblNewReleasesFinal"

MsgBox "No new releases for report run at " & Now(), vbOKOnly
DoCmd.SetWarnings True

Else

RunCommand (acCmdSelectAllRecords)
RunCommand (acCmdCopy)
DoCmd.OpenTable "Released Kits"
RunCommand (acCmdPasteAppend)
DoCmd.Close acTable, "Released Kits"
DoCmd.Close acTable, "tblNewReleasesFinal"

DoCmd.SendObject acSendTable, objectname:="tblNewReleasesFinal",
to:="xxxxxx", cc:="yyyyy", subject:="New Releases", _
messagetext:="yyyyy, add any Safedisc or DVD releases to appropriate tab in
GPS." _
, outputformat:="HTML", editmessage:=False

DoCmd.SendObject acSendTable, objectname:="tblNewKitsWithPrintComp",
to:="xxxxx", cc:="yyyyy", subject:="New Releases with Print Components", _
messagetext:="xxxxx, please download and store these new kits." _
, outputformat:="HTML", editmessage:=False

DoCmd.SetWarnings True
End If

End Sub
============================================
Any help appreciated,
David
 

Archived message: help with error message (Microsoft Access Database)