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.