Dim Adb1 As New Microsoft.Office.Interop.Access.Application
Dim wsh As Object
Dim printer1 As String = "HP Officejet 6500 E709a Series"
Dim printer2 As String = "Microsoft Office Document Image Writer"
wsh = CreateObject("WScript.Network")
wsh.SetDefaultPrinter(printer2)
Dim numWorkOrdVL1 As Integer
numWorkOrdVL1 = txtQCCOAL1VL.Text
Adb1.OpenCurrentDatabase("C:\DB\Main Application.mdb")
Adb1.DoCmd.OpenReport("rptQCCOAL1VL", AcView.acViewNormal, , "WorkOrd=" & numWorkOrdVL1)
Adb1.CloseCurrentDatabase()
Adb1.Quit()
wsh.SetDefaultPrinter(printer1)
|