Printing an Access Report from an open Database in VB6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • waltonlv
    New Member
    • Sep 2006
    • 1

    Printing an Access Report from an open Database in VB6

    I have looked at several coding examples on printing an access report within VB, but am having a problem with the .OpenCurrentDat abase command. When executed, I get the message "Database is already open". If I comment out this command and just execute the .DoCmd.OpenRepo rt, I get the message "You can't carry out this action at the present time"

    The code looks like this:
    With objAccess
    .OpenCurrentDat abase filepath:="path name"
    .DoCmd.OpenRepo rt "reportname "
    End With

    I have no problem when printing from another (closed) database, but I am stumped on how to print from an active database.
Working...