Solved
DoCmd prints to web server printer and not client
Posted on 2011-09-29
I created a connection to the access database and configured IIS along with permissions and app pool settings. When I run this code from the client machine via web browser, it calls the report and prints it to the default printer of the web server and not the client's printer.
Obviously, I cannot do this where I need to print to the clients printer. Any ideas?
Imports System.Data.OleDb
Imports System.Data
Imports Microsoft.Office.Interop.Access
Imports Microsoft.Office.Interop.Access.Dao
Imports Microsoft.Office.Core
Partial Class jobreview
Inherits System.Web.UI.Page
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
Dim MSA As New Microsoft.Office.Interop.Access.Application()
Dim cboJobNums As String
cboJobNums = Session("NewJob")
MSA.Application.Visible = False
MSA.OpenCurrentDatabase("path to db", False)
MSA.Application.DoCmd.OpenReport("rptJobFormPrint_EDBS", AcView.acViewNormal, WhereCondition:="[Jobs].[Job No]= '" & cboJobNums & "'")
MSA.Application.DoCmd.Close()
MSA.CloseCurrentDatabase()
End Sub
End Class