Hello I have created a userform in Excel that controls other programs in order to process Commission Requests, and one of the programs is an Access Database. I am currently able to open the database but none of my commands run. Basically I am only wanting to run an Append Query and print 2 Reports. The Append Query updates the table with the new commission request information and the reports are sent to Accounting for processing. If you have any useful tips that would be greatly appreciated!
<CODE>
Dim strDocName(1) As QueryTable
Dim strRptName(1 To 2) As Report
strDB = strFilePath & "Travel Agent Commission.mdb"
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase strDB
strDocName(1) = "Append Upload File to Commissions Table"
appAccess.DoCmd.OpenQuery strDocName(1)
strRptName(1) = "TRAVEL AGENT COMMISSION CHECK REQUEST FORM"
appAccess.DoCmd.OpenReport strRptName(1), acViewPreview
appAccess.DoCmd.PrintOut
strRptName(1) = "Travel Agent Commission Inquiry"
appAccess.DoCmd.OpenReport strRptName(1), acViewPreview
appAccess.DoCmd.PrintOut
appAccess.CloseCurrentDatabase
</CODE>
Travis
<CODE>
Dim strDocName(1) As QueryTable
Dim strRptName(1 To 2) As Report
strDB = strFilePath & "Travel Agent Commission.mdb"
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase strDB
strDocName(1) = "Append Upload File to Commissions Table"
appAccess.DoCmd.OpenQuery strDocName(1)
strRptName(1) = "TRAVEL AGENT COMMISSION CHECK REQUEST FORM"
appAccess.DoCmd.OpenReport strRptName(1), acViewPreview
appAccess.DoCmd.PrintOut
strRptName(1) = "Travel Agent Commission Inquiry"
appAccess.DoCmd.OpenReport strRptName(1), acViewPreview
appAccess.DoCmd.PrintOut
appAccess.CloseCurrentDatabase
</CODE>
Travis