Results 1 to 2 of 2

Thread: Problems with Access Report

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Question

    Hi.

    I'm trying to display an Access Report from VB. Here are my issues/questions.
    • The report has a Password, but the code that I am using to supply the password to the report isn't working.
    • When Access opens up, I want it to be maximized. Currently, it isn't.
    • Will I have any problems installing this app on a machine that doesn't have Access? Of course, I'll use the P&D Wizard to make sure that all of the necessary DLL's are included.
    Here's the code.
    Code:
    Private Sub cmdInvoice_Click()
        'This report Displays the Sales Invoice,
        'which is a MS Access Report.
    
        Dim aReport As Access.Application
    
        On Error GoTo ErrorRoutine
    
        Set aReport = New Access.Application
    
        aReport.DBEngine.DefaultUser = "Admin"
        aReport.DBEngine.DefaultPassword = "openmydb"
    
        aReport.OpenCurrentDatabase "C:\WINDOWS\Desktop\Current Projects\Book Store Project\BookStoreDB.mdb"
        aReport.Visible = True
        aReport.DoCmd.OpenReport "Invoice", acViewPreview
        aReport.DoCmd.Maximize
    
        Exit Sub
    ErrorRoutine:
        DisplayError "Counter Sales Form: cmdInvoice_click"
    End Sub
    Thanks, in advance, for any guidance.

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Back to the top!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width