473,657 Members | 2,680 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I print a report based off of a continous form's search results?

7 New Member
Hello,

I currently have a continous form that has a search field in the header. The search works without issue, but I want to be able to print a report based off the search results.

All the records have there own unique Record ID and they are all pulled from the same table.

I know how to print a report based off 1 record, but I can't for the life of me figure out the above problem.

Any help would be greatly appreciated.

I have MS Office - SP2 on Windows Professional.

Thanks
Nick
Feb 11 '08 #1
3 1901
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Depends on how your search works on the form. If your search box applies a filter to the records in your form via the control's after_update event, you can place a report button on the form which will open the report and apply the same filter to the report when it is opened, hence showing the same records. It takes very little programming of the on-click event of the report button.

Here is an example of a similar technique, used in this case to pick specific departments on which to report. This is from a selection form which uses two combo boxes, first_dept and last_dept, to select from a list of ordered departments. The default for the combos is "*" for show all, and as you will see from the code if this is the combo value the report is opened without a filter.

If the user selects specific departments the report is opened with a filter condition to show only the reports from the first to the last departments specified.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Click()
    Dim stDocName As String
  2. stDocName = "ACT001" ' change this to the name of your report
  3. '
  4. ' change the control name to the name of the search control in your
  5. ' form, and apply whatever filter is appropriate for your circumstances
  6. '
  7. If Me.First_Dept = "*" Then
    DoCmd.OpenReport stDocName, acPreview
    Else
    DoCmd.OpenReport stDocName, acPreview, , "[Sequence No] between " & Me.First_Dept.Column(4) & " AND " & Me.Last_Dept.Column(4)
    End IfEnd Sub
Cheers

Stewart
Feb 12 '08 #2
NMarks
7 New Member
The Search is actually done by an On-Click Command.

I have multiple text boxes allowing a user to search by 4 different items as well as by date range.
Feb 13 '08 #3
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Ok, if it is an on-click response you are presumably building a filter condition or SQL 'Where' clause which filters the dataset based on the values in your text boxes. You should be able to use the same filter or SQL statement to filter your report...

If you can attach the VBA code for the on-click it would help to clarify next steps.

-Stewart
Feb 14 '08 #4

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

Similar topics

6
2071
by: B Love | last post by:
I am wondering if I can have a dynamically generated report based upon the results of a query (in Access2000). Any ideas? Related to that (if that cannot be done) can the output of a query generate a set of records in form view. ( The second request sounds even more impossible to the first!) . Thanks for any insight you can share with me! ~Bruce
1
2123
by: DD | last post by:
I have a mainform with a subform. The main form as a dropdown box "chooseDate", in the afterupdate event i requery the subform so all records with the same date are viewed. Now i only want to print the selected records of the selected month Can any one advise on the code to add to the print button i have tried this StrLinkCriteria = ".forms! = " & Me! this does not work
4
2403
by: Jan | last post by:
I am having problems trying to print a report based on a form. This is a search form only, no data input. There is a query that the form looks at, but then there are numerous comboxes that you can pick information from either one or many and press a search button. See code below for the "Case Select" that was used to make up the comboboxes. Not a filtered list. My problem is that when I try to print, it prints all records before the...
2
2081
by: vulcaned | last post by:
Hi All, I'm stuck, so....... In Access97 I have a form which has a subform(setup as a continous form), after a user selects several things on the form the subform gets requeryed and displays the content approperiate to the selections the user made. Now, the user wants to print the sub-form only. I've tried putting a print button on the sub-form and have tried both 'docmd.printout' and 'docmd.printout acSelection' in the on click...
5
4538
by: Nothing | last post by:
I have a search results form that is being displayed as a continous form. I want to double click the name and then using VBA select the different columns of information. For Example: Name City DL# Last Bid# Michael Toledo Unknown 139 Robert Cleveland 123456 254
1
2127
by: mfaisalwarraich | last post by:
Hi Everybody, I have an external database called Patients.mdb where i made a query called qryAdmissionDetails. now i want to run this query on a report of another database called PatientDetails.mdb. how i can do this? can this be done by setting the recrodset of a continuous form to the recordset of qryAdmissionDetails and then printing that continous forms to a report? please tell me how i can do this. code for setting the recordset of...
12
3529
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 print the report three times, but do not know how
10
9115
by: Snoopy33 | last post by:
I have a DB that I developed on access XP (2002) and deployed over a year ago. No one has had problems printing any of the reports within the DB until we started loading 2007 on new computers. The access 2007 users cannot print one of the reports. This is maddening since I cannot duplicate the issue on any computer that runs 2003 or below. Is there something going on that I'm not seeing? Does anyone have any suggestions at all on...
3
2928
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 for the page i give here...Frankly said, i am a noob in CSS....Please help me....Here is my HTML Page and i want only the <div id="pageloader"> to be displayed.. <%@ page session="true" %> <%@ page import="java.util.*" %> <%@ page...
0
8407
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
8837
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8512
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
8612
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...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
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
4171
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...
1
2739
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
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.