HResult 0x800A0C4F When Run Access Report from VB 2008

  • Thread starter Thread starter Ebassador
  • Start date Start date
E

Ebassador

VS 2008 with Office 2007. Using .Net 3.5 and interop services.

When oAccess.Run is executed, error results as shown above.

Here is the code:

Friend Function doReport(ByVal rName As String,
Optional ByVal sView As Access.AcView = Nothing, _
Optional ByVal sFilter As String = "", _
Optional ByVal sWhere As String = "") As Boolean
Dim oAccess As Access.Application = CreateObject("Access.Application")

oAccess.Visible = False
oAccess.OpenCurrentDatabase(getConfigVar("dbLocation", True, True))
oAccess.DoCmd.Minimize()
oAccess.Visible = True
oAccess.Run("OpenAccRpt", rName, sView, sFilter, sWhere & " ")
oAccess.DoCmd.Maximize()
doReport = True
End Function
 
oAccess.Run("OpenAccRpt", rName, sView, sFilter, sWhere & " ")

Try replacing with

oAccess.DoCmdOpenReport <report>, <view>, <filter>, <where>

hth
--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
Back
Top