DataBase - Print Access report along with an outside checklist

Asked By Gabby Girl
20-Mar-10 02:28 PM
Good afternoon

Is it possible to print a report that is in Access and then right after print
an Excel checklist?

Background:

I work for a large construction company that does regular maintenance on
their equipment.  Right now we print a parts ticket of the parts required for
the particular service they are doing & then we print a copy of the
manufacturer's check list of what should be done (which is an excel
document).  They would like to automate this procedure so that when you print
the parts ticket it will automatically print the required manufacturer's
check list.  I have added a field to the parts ticket that holds the path &
name of the related checklist but am now stuck on the code to print both at
the same.  Is this even possible?

Any advice is greatly appreciated.

Thanks
Excel
(1)
DoCmd.Printout
(1)
Report
(1)
AcPageRange
(1)
Mspreadsheet
(1)
Macroname
(1)
Sepaate
(1)
Spooler
(1)
  bhicks11 via AccessMonster.com replied to Gabby Girl
22-Mar-10 07:25 PM
Hi Gabby,

You can use the Shell command to open the spreadsheet, run a macro that
prints it and exits the program (create the macro first).  Here is a sample:

Dim mspreadsheet
Dim macroname

mspreadsheet = "C:\spreadsheet.xls"
macroname = something

Shell ("excel.exe" & " " & mspreadsheet & macroname)

Bonnie
http://www.dataplus-svc.com


--
Message posted via http://www.accessmonster.com
  Dennis replied to bhicks11 via AccessMonster.com
22-Mar-10 11:10 PM
Bonnie,

Cool idea, but let me ask this question.

As I understand this solution, the Excel printout will be a sepaate spooler
file that prints independently of the main report.  That is, I am going to
guess that the Excel spread sheets will print first and the then complete
access report will print.

Someone will have to manually colate the excel print out with the access
parts tickes.

Maybe I am way off base but I am guessin that Gabby would like to print a part
tickets and then immediately print the excell check list.  That way manually
collation of the two different reports would be minimized.

Is there any way to print a page in Access and close that spool file, which
will cause that page to be printed, run the excel shell to print the
spreadsheet, and then open a new spool file for the next page, and repeat the
process again?


I ask this question, because I have a similar issue.


Thanks

Dennis
  bhicks11 via AccessMonster.com replied to Dennis
23-Mar-10 12:34 PM
The PrintOut method has page range option and applies to the active object.
So, open the report and run:

DoCmd.Printout acPageRange, 1,2

See Access Help.

Bonnie




--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/201003/1
  Dennis replied to bhicks11 via AccessMonster.com
23-Mar-10 10:32 AM
Bonnie,

Thanks for that little gem.

Dennis
Create New Account
help
change the printer's orientation to give the maximum size image. Can do it with Excel, but that is cheating code is Function PrintIt() ' ' PrintIt Macro ' Macro recorded 02 / 04 / 2009 R$47" .PrintOut Copies: = 1, Collate: = True End With End Function Thanks Phil Access Discussions DoCmd.PrintOut (1) Excel (1) AllocationPlan.Picture (1) PageSetup.PrintArea (1) Database (1) Report (1) Application.FollowHyperlink (1) ActiveSheet (1) - -- --BEGIN PGP SIGNED MESSAGE- -- -- Hash: SHA1 Access also has the PrintOut method: DoCmd.PrintOut . . . etc. . . . It will print form pages, report pages, etc. See the Access Help article "PrintOut Method" for more info (hint: in the
form I've set up a button to save and open the results in an Excel file. I would also like to have a button on the parent form that will Modules DAO Discussions Windows XP (1) DoCmd.SelectObject (1) DoCmd.RunCommand (1) DoCmd.OpenQuery (1) DoCmd.PrintOut (1) Excel (1) DoCmd.Close (1) AcCmdWindowHide (1) Use a report. It is the correct way and the easy way. - - Dave Hargis, Microsoft Access MVP Okay String strName = me.lblQryName.caption DoCmd.OpenQuery strName DoCmd.RunCommand acCmdWindowHide DoCmd.SelectObject acQuery, strName DoCmd.PrintOut acSelection DoCmd.Close acQuery, strName I had to put a docmd.maximize in the form them. ;-) Yes, I've gathered that from reading other threads. Here's my issue: The report would be based on a combo box selection on the form; thus, the report's
and bellow is the current code that i have to set a criteria for my report. thanks for your help again. . . . . If Me.sched.ItemsSelected.Count = 0 Then Beep MsgBox "no 4 If lngLen > 0 Then strDescrip = "Production Required: " & Left$(strDescrip, lngLen) End If End If 'Report will not filter if open, so close it. For Access 97, see note 3. If Len(strModelNum) - 1 If lngLen > 0 Then strModelNum = "[ID_1] IN (" & Left$(strModelNum, lngLen) & ")" End If 'Report will not filter if open, so close it. If CurrentProject.AllReports(strDoc).IsLoaded Then DoCmd strDoc, acViewPreview, WhereCondition: = strWhere & " AND ', OpenArgs: = strDescrip Resp = MsgBox("Print??????", vbYesNo) If Resp = vbYes Then DoCmd.PrintOut Else DoCmd.OpenReport strDoc, acViewPreview, WhereCondition: = strWhere & " AND ', OpenArgs: = strDescrip - - Message posted via http: / / www with the docmd.openreport, and have a where condition as you already know. however, my report have only three items, vendor, item and quantity and none are the criteria "strWhere". the only way i could get the report open is if i include the strWhere criteria, in this case OrderNo, in the rowsource of the report. it's there a way to go around this, and do i explain myself clearly
Excel Report Builder report is deleting the last column from SQL v DataBase I am using Excel Reports in conjunction with Smartconnect. After about a dozen smartconnect connections and refreshes of data from GP in my excel report, the original SQL view created from the Excel Report Builder deletes the last column from the SQL view. I am now unable to refresh