I have looked at several coding examples on printing an access report within VB, but am having a problem with the .OpenCurrentDatabase command. When executed, I get the message "Database is already open". If I comment out this command and just execute the .DoCmd.OpenReport, I get the message "You can't carry out this action at the present time"
The code looks like this:
With objAccess
.OpenCurrentDatabase filepath:="pathname"
.DoCmd.OpenReport "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.