RE: Printing an Access report using late binding

Tech-Archive recommends: Fix windows errors by optimizing your registry



Dirk,


Sorry I am still missing somthing. How do I get the View to work correctly
with late binding?

It does not understand what acViewnormal means? I forgot to switch back to
late binding before running my last test.

Now that I am using late binding again it shows a dialog which I would like
to avoid.

Thanks, Leo
--
Thank You, Leo


"TrussworksLeo" wrote:

Hello,

I am having problems getting access to print using late binding. I am
specially
having problems with this line and the ObjectType property

oAccess.DoCmd.SelectObject(ObjectType:=oAccess.AcObjectType.acReport,
ObjectName:=Report, InDatabaseWindow:=True)

How do I tell it to use a access report with late binding?

Here is all the code:

Dim sDBPath As String 'path to Reports.Adp

Dim oAccess As Object
'oAccess = CreateObject("Access.Application")

' The path to Reports.Adp:
sDBPath = "C:\Alpine\Ais\Reports.adp"

' Open Reports.adp in shared mode:
oAccess.OpenCurrentDatabase(filepath:=sDBPath, Exclusive:=False)

' Select the report name in the database window and give focus
' to the database window:

oAccess.DoCmd.SelectObject(ObjectType:=oAccess.AcObjectType.acReport,
ObjectName:=Report, InDatabaseWindow:=True)

oAccess.DoCmd.OpenReport(ReportName:=Report,
View:=oAccess.AcView.acViewNormal)

Thank You, Leo
.



Relevant Pages

  • Printing an Access report using late binding
    ... I am having problems getting access to print using late binding. ... having problems with this line and the ObjectType property ... Dim oAccess As Object ... ' Select the report name in the database window and give focus ...
    (microsoft.public.access.modulesdaovba)
  • Re: Declarations
    ... > What you ought to do is to investigate Late Binding. ... Using the references ... > Dim oAccess as Access.Application ... > New statement to a CreateObject() function. ...
    (microsoft.public.word.vba.general)