access.course - printing reports
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Access Training and help » access.course - Printing reports

access.course - Printing reports

The UK's most regular instructor-led training courses.
Training information: access.course · Microsoft access courses · Microsoft Access Training
See also · microsoft access training · access vba courses · access database course

resolvedResolved · Low Priority · Version Standard

Printing reports

Steven has attended:
Access Intermediate course

by - delegate Steven [2 posts] (2007 May 12 Sat, 15:48) replyReply

I am using data entry forms and the customer will need a hard copy of what has been entered. Obviously forms are not really optimized to print pretty however the report I have set up prints all the records. I want to set up a command button on the form page for the data entry user to print off the report. How can I print off only the active form using reports?
Thanks Steve

Access Advanced 1 day course
Version Date Location Places
available
Book Next place rate:
Card Invoice
2003 2008 Dec 3 Wed Southwark 5 book now £219 £235
2003 2008 Dec 19 Fri Bloomsbury 5 book now £219 £235
2003 2008 Dec 24 Wed Bayswater 0 FULL    
2003 2009 Jan 7 Wed Southwark 7 book now £203 £230
2003 2009 Jan 14 Wed Bloomsbury 8 book now £187 £224
2003 2009 Jan 23 Fri Bloomsbury 7 book now £203 £230
Full Schedule: See all 45 Access Advanced course dates.
Bookings currently available until 25th November 2009.

RE: Printing reports

by - trainer Richard platinum contributer[818 posts] (2007 May 24 Thu, 10:51) replyReply

Hi Steven

Depending on your data and your experince with Access, there are probably several options to do this.

1.
There is a DATASHEET view of the form that you are entering available under VIEW > Datasheet. This will normally show all records that you are using or entering.

One way to get around the "all records" issue, is to use a Macro to open the form in ADD ONLY mode. This means that when ever you enter data, and want to print only that entered data, you can do so.

To do this, click on Macros, then create a new macro.
Use the OPEN FORM command, and then specify the form in the options below (1st option). Then go to DATA MODE, and select ADD ONLY. Save and run the macro.

Once you add the records to your form then you can use VIEW > DATASHEET for a table view to print.


2. If the above does not work for you, you might consider hacing a field that tracks each batch of form entries. For example, if you wanted to only print TODAY's entries, add a DateEntered field to the underlying table and set the default value to "=date()". This will automatically set tat field to have todays date in it. You would then setup a query that pulls only TODAYS records from the table, and then create the report from that.

If you want to BATCH enter data, and it is not based on the date entered, and is perhaps a JobNumber or something similar, you could use the same type of solution. Just add the field to the table, and then enter the variable in the field on the form when you are capturing new records.


You could still add a button to the form to activate the report, but the command button would only open the report. (unless you want to have the SQL in the macro, rather than the report tunning off a fixed query - of course you need to know SQL to do this.)

Let me know if that helps.

Regards

Richard

RE: Printing reports

by - delegate Steven [2 posts] (2007 May 24 Thu, 11:03) replyReply

Hi Richard
Some very helpful guy gave me the code to put to paste onto command button and it works every time.

The code
Private Sub cmdPrint_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub

Regards
Steve


Related articles

· 3 Useful Things You'll Learn in Microsoft Access Training Courses
· Reasons to Consider Microsoft Access Training
· Microsoft Access Cheat Sheet: Tips and Shortcuts
· 3 Reasons to Switch from Excel to MS Access - You'll be Glad You Did!
· Turning your Spreadsheets into Interactive Data Warehouses with MS Access Courses

Access tip:

Add current time to a field

Press CTRL+SHIFT+ SEMICOLON

View all Access hints and tips

Rate this page:
4.0/5 (3 votes cast)
Institute of IT Training - Accredited Training Provider Microsoft Certified Partner
microsoft office
Microsoft Office Specialist Authorised Testing Centre (MOS and MCAS)

Prodigy Platinum Learning Partner

Institute of IT Training - Accredited Training Provider Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information

Training Articles

AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz