473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Print Document direct from the form

Hello

I am finding a problem in code to generate an output direct from Access Form. I am explaining my problem with the help of example

I designed an invoice form on the MS Access and designed this document in MS Access Report designer and Crystal Report as well. What i need to do if i am on MS Access form and i am on invoice # 100 when i press "Print" button then from report invoice # 100 will be print.

Kindly send me a code which will use in print button.

Hafeez
Jun 17 '06 #1
2 5306
PEB
1,418 Expert 1GB
You need to use:
1. docmd.openreport command for more info see help in Access about it

2. You need to change the SQL passed on the report! You have to introduce an filter that shows only the current record! This filter you can pass it bythe command docmd.openreport

The code as well as U do Copy Paste I can't do it without information about your Tables, queries, forms and reports that U use!

U have only to see the use of docmd.openreport as Macro or Code as U want!
Sep 3 '06 #2
MMcCarthy
14,534 Expert Mod 8TB
You need to set criteria for opening the report same as with forms.

Expand|Select|Wrap|Line Numbers
  1. Private Sub butPrint_Click()
  2. Dim stDocName As String
  3. Dim stLinkCriteria As String
  4.  
  5.     stDocName = "ReportName"
  6.     stLinkCriteria = "[InvoiceNo]=" & Me.[InvoiceNo]
  7.     DoCmd.OpenReport stDocName, acViewNormal, , stLinkCriteria
  8.  
  9. End Sub
  10.  
Hello

I am finding a problem in code to generate an output direct from Access Form. I am explaining my problem with the help of example

I designed an invoice form on the MS Access and designed this document in MS Access Report designer and Crystal Report as well. What i need to do if i am on MS Access form and i am on invoice # 100 when i press "Print" button then from report invoice # 100 will be print.

Kindly send me a code which will use in print button.

Hafeez
Sep 3 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Craig | last post by:
First of all, this one is driving me crazy, so thanks in advance for any help!! I've got a javascript function in a parent document that generates an HTML document on the fly when a button is...
13
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
3
by: James J. Besemer | last post by:
I would like to champion a proposed enhancement to Python. I describe the basic idea below, in order to gage community interest. Right now, it's only an idea, and I'm sure there's room for...
2
by: prophet | last post by:
how do I create a print button that is on my index page that prints my target page (and only the target page) I tried <INPUT onclick=window.print(); type=button value="Print This Page"...
2
by: Brad Pears | last post by:
I have some sample code that uses the print dialog, print preview and a print direct options. If I select print preview and then click the printer icon from that, the document prints. If I...
1
by: rfr | last post by:
I have a need to use a single version of a Visitor Response Feedback Form on numerous HTML documents. Rather than have numerous versions of this, one on each HTML document, it makes more sense to...
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
3
by: rajkumarpb | last post by:
Hi friends, I am new to this forum...But not for programming...I want a Print CSS File to be added in my page..OK.... Here is the page and i want you friends to help me create the CSS File...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.