473,804 Members | 3,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with report / print from form with query??

I have looked on the groups but can't seem to find an answer. I have a
parameter query that uses a form for its input. This form then opens
up a search result form based on the query. It is from this form that
I want to print via a report all of the returned records shown on the
form.

I can print off a single current record shown in the form (say record
3 of 5) using this code:

Private Sub cmdPrintCurrent _Click()
Dim strReportName As String
Dim strCriteria As String
strReportName = "report1"
DoCmd.OpenRepor t strReportName, acViewPreview, , Wherecondition: ="id =
" & Me.id
End Sub

How can I use this as a basis for printing off all of the returned
records on the form from the query?

I am resonable with Access but not that good with VBA (yet!).

Many thanks
Nov 12 '05 #1
1 5861
What you need is the WHERE clause (criteria) used to open the Form, not the
current record's ID. Where you would find that and how you would use it will
depend on the exact method you used to open the Form. If you used the Where
Condition or Filter of DoCmd.OpenForm, you may find the criteria you need in
the current Form's Filter property. If that's not the case, clarify and
someone will likely have a suggestion for you.

Larry Linson
Microsoft Access MVP
"Aftershock " <ra*****@jamesw hittaker.com> wrote in message
news:a5******** *************** ***@posting.goo gle.com...
I have looked on the groups but can't seem to find an answer. I have a
parameter query that uses a form for its input. This form then opens
up a search result form based on the query. It is from this form that
I want to print via a report all of the returned records shown on the
form.

I can print off a single current record shown in the form (say record
3 of 5) using this code:

Private Sub cmdPrintCurrent _Click()
Dim strReportName As String
Dim strCriteria As String
strReportName = "report1"
DoCmd.OpenRepor t strReportName, acViewPreview, , Wherecondition: ="id =
" & Me.id
End Sub

How can I use this as a basis for printing off all of the returned
records on the form from the query?

I am resonable with Access but not that good with VBA (yet!).

Many thanks

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2916
by: Koen | last post by:
Hi all, I've struggled with the following problem and welcome all a suggestions to solve this. I have a form that list records from a table with observations. The record source for the table depends on from where the form is opened, but always looks like: SELECT tblObservation.* FROM tblObservation WHERE ...
6
2249
by: John | last post by:
Hi, I have simple database based on 3 tables. Relationship is 'one to many' between table 1 and 2, also between 2 and 3 table'one to many'. I have made form where I enter data in all 3 tables. Form has 2 subform based on relationships. I want to make report to print data which is shown on form. I want to print only data from form, not whole records from tables. Does anyone knows how to do this? I have tried with report based on query,...
1
17684
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
1
1535
by: Simon Matthews | last post by:
Hope someone can help an Access beginner! I've just started keeping my surgical logbook on access and it's a simple flat-file affair. I have created several queries that will list cases performed at different hospitals and reports based on the queries to print out the relavent details. What I would like to do is have a summary sheet in the Report Footer section that lists a grid of each type of procedure performed as well as the...
4
4742
by: Sami | last post by:
I hope someone will tell me how to do this without having to do any VB as I know nothing in that area. I am a rank beginner in using Access. I have created a database consisting of student athletes.  I have now learned how to join two different tables in a query so that I might generate a report. Specifically, student athletes at a community college are required to graduate with an AA or AS degree.  Consequently, various steps are in...
17
2039
by: so many sites so little time | last post by:
all right so the script is pretty simple it goes it retrives what the id of the post is and it lets you edit it well no it doesnt. now if you go to www.kirewire.com/pp2/index/php you will see a number 1 that is the value of collumn home_id which is set to auto increment ect ect but this script which gets the id of home_id of a row and lets you edit it does not work for somereason...
2
2087
by: Bill | last post by:
I have a 200 record database that includes a date/time field, AnnivDate, for a wedding anniversary. AnnivDate has nulls and some incorrect year data. I have been creating the Access database using data imported from an Excel file and the person entering into Excel only cared about the month and day portion and Excel added the current year to the field value. I want to produce a report that shows upcoming anniversaries using a parameter...
7
2065
by: google | last post by:
I am trying to automate the way reports are printed in an Access 2003 database - I have ~200 records (people) who require between 5 and 10 customized reports (depending on values within certain fields) - currently I print each report by selecting all employees and printing one report at a time - once all reports are printed, I manually collate the packages - I would like to be able to have a combo box (or other option) highlight the...
1
2277
by: chienee | last post by:
here is the code <?php session_cache_limiter('private,must-revalidate'); session_start(); require_once("config.php"); include ("classes/db_functions.php"); include ("classes/display.php");
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10326
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10317
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.