Search Form - Print

Jun 21, 2007

I have been on numerous topics on this site and managed to pick up bits here and there to get my db to work as I would like with the exception of the print report button.

I can preview the result in a subform of the search that I have done, and it is this I would like to print – not sure what this should be as you can search on numerous criteria.

Edited - removed code and added file

View Replies


ADVERTISEMENT

Search Database And Print Report

Nov 11, 2004

I've created a Report called "Labels". I would like to use a program mwalts gave
me that searches my database and then sends out a mass email. I would like to take
this program and instead of it searching the database and sending an email, have it search
my database and print out the results in a report.

Can someone tell me the command lines I would need to add to the following program to do this?
I would like to just take out the email parts of the code and just substitute them with the print
label parts.

Thanks.

Code:'Designed by M. Walts'Important information! this code requires a reference to the Microsoft DAO object libraryOption Compare DatabaseOption ExplicitPrivate Sub cmdEmail_Click()'will hold the dynamic SQL queryDim strSQL As String'will hold the WHERE clause portion of our SQL queryDim strWHERE As String'will hold all the recipients of this messageDim strRecipients As String'the recordset we will use to get the emails of the records that match our criteriaDim rst As DAO.Recordset'if there is input in the search criteria, then we will run the query and send the e-mailIf txtSearch <> "" Then'if you have more buttons, just add mosr cases (the value of the radio button'= the Case number, so Value of the State radio button is 1, etc.)Select Case opgSearch.ValueCase 1strWHERE = "WHERE State = '" & txtSearch & "'"Case 2strWHERE = "WHERE City = '" & txtSearch & "'"Case 3strWHERE = "WHERE Denom = '" & txtSearch & "'"Case 4strWHERE = "WHERE Conference = '" & txtSearch & "'"Case 5strWHERE = "WHERE Donor = '" & txtSearch & "'"Case 6strWHERE = "WHERE MailingList = '" & txtSearch & "'"Case 7strWHERE = "WHERE YouthPastor = '" & txtSearch & "'"Case 8strWHERE = "WHERE PrayerSupport = '" & txtSearch & "'"Case 9strWHERE = "WHERE PACTTrainer = '" & txtSearch & "'"Case 10strWHERE = "WHERE PACTPartner = '" & txtSearch & "'"End SelectstrSQL = "SELECT EMail FROM tblUser " & strWHERE'run the query and get the results into the recordsetSet rst = CurrentDb.OpenRecordset(strSQL)'Loop through the recordset and add all the EMailsDo While Not rst.EOFstrRecipients = strRecipients & ";" & rst!EMailrst.MoveNextLoop'remove the first ; from the strRecipientsstrRecipients = Right(strRecipients, Len(strRecipients) - 1)MsgBox strRecipientsDoCmd.SendObject , , , , , strRecipients, txtSubject, txtBody, Falserst.CloseSet rst = NothingEnd IfEnd Sub'stops a ' entered in the field from breaking the queryPrivate Function SQLSafe(safeMe As String) As StringSQLSafe = Replace(safeMe, "'", "''")End Function

View 10 Replies View Related

Modules & VBA :: Print Report Based On Multi Search Not Working?

Jun 5, 2014

i have created a MultiSearch query witch puts my results in a list box.under it i have created a button wich i want to use to print a report with the criteria i select from my list box if there is more than one result.

Following is the Code i used for my button

On Error GoTo Err_Command60_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ReportLable"
stLinkCriteria = "[ProductID]=" & Me![SearchResults]
DoCmd.OpenReport stDocName, , , stLinkCriteria
Exit_Command60_Click:
Exit Sub
Err_Command60_Click:
MsgBox Err.Description
Resume Exit_Command60_Click

Every time u press the button i get a message syntax error(missing Operator) in query expression

Now i have not used any code in my Query except for

Like "*" & [forms]![frmSearchFor]![SrchText] & "*"

Where i made the error

View 3 Replies View Related

Forms :: Print Report Based On Subform With Multiple Search Criteria

Jun 14, 2015

I have a problem printing a Subform that uses multiple criteria(in textboxes) as filters.

The search portion of the form works fine. The problem is I have created a report based on the subform and am using the following code to open/filter the report

Code:
Private Sub PrintBtn_Click()
Dim strCriterion As String
Dim strMsg As String, strTitle As String

[Code].....

View 3 Replies View Related

Queries :: Search Form That Uses A Query To Show Results Of A Search

Aug 5, 2014

I have a search form that uses a query to show results of a search, but everytime I press search everything comes up even though I have entered search parameters, even though my search requeries every time and the search used to work before I added new records today. Also when I press the query alone on the navigation pane it asks me for the parameters and then it actually works but it won't when I use my form.

View 2 Replies View Related

How To Create Search Button Using Access 2007 That Can Search From Form

Jul 10, 2012

i need to create a system that can search data using keyword.so i want to create search button that i will create it at form. currently i have 1 table and in that table i have 10 fields which are project_name, doc_ref_no, doc_title, volume, book_no, author, doc_status, box_barcode, filling_location, doc_availability.

i have create 2 forms, one form for user to add new record and another one is to search record. the user can search by enter project name, doc title, volume and box barcode. for project name and volume, i use combo box and for doc title and box barcode i'm using text box.

i want to create search function that can detect from user keyword and even user did not fill in all the form, the system still can search the record.

View 5 Replies View Related

Forms :: Search Combo Box To Search For A Field On Form

May 7, 2013

I have a search combo box to search for a field on my form. But it just goes to that particular record. The combo box is for client id and it has more than one record. How can I have it return just the records pertaining to the client id choosen in the combo box.

View 5 Replies View Related

I Want To Print A Report And Programmatically Set The Printer Name And 'Print To File

Jul 16, 2007

How can I print a report and at the same time programatically set the printer name and 'Print to File' option and set the path of this option?

View 1 Replies View Related

How To Hide Or Disable Print Or Quick Print Options

Dec 4, 2014

I have a form which my company wanted that each single record should be printed from form. I made a print record button and put code to print single page or record. However as a natural habit people go to file > print to print which leads printing all records so 1000's records start printing. Is there any way i can hide print button. File >Print button.

View 1 Replies View Related

How To Print Hidden Form Using Visible Form Only - MS Access 1 Table And 2 Forms

Nov 24, 2014

I have a Lost/Found property database which we use to keep record of the lost/found property and it is working fine.

As per our organization's policy, we keep the item(s) for up to three months in which if it gets restored to the owner then fair enough otherwise after three months the item(s) can be claimed by the "Finder". But for this very purpose we issue the Finder with a "Claim Receipt" which he/she should bring in when claiming for the item(s) after three months period. Therefore, It's just the right time to upgrade the database to a more professional level.

The database has one table and two forms.

One form (LostFoundForm) is visible to the user in which they enter data, this form has two sections; Item(s) & Finder's details and the second section is about Restoring details.

However the second form (ClaimReceiptForm) is hidden to the users (for manual data entry) and has only one section which is exactly the same as the first form's first section, i.e., Item(s) & Finder's details. This second form takes the data automatically from the first form because the table behind them is same and fields are same (please see attachment). Up to here it's all working fine.

I would like to introduce a Checkbox or a CommandButton in the LostFoundForm which when we click should pull up a msgbox asking "Do you want to print the receipt for this item(s)?" with a Yes/No option. On clicking "No" it should, obviously, settle down but on clicking "Yes" it should print the "corresponding record" from the ClaimReceiptForm.

View 3 Replies View Related

Print Form, HELP!

Mar 31, 2006

Hello!

I would like to be able to print a specified form when a new record is added to my database.

I have an add form which can be filled in, and there is an "Add" button at the bottom of the page, when this is clicked, I want the record to be added but also a specified form to be printed named "frmKitChecklist".

As I am a VB noob I do not know the code to do this, please could someone help me!

Thanks :)

View 3 Replies View Related

Print From Form Vol. 2

Oct 4, 2005

I got the command buttons to print the reports I wanted from the forms.
I now have a data entry form (data entry = yes). I would like to print a report from this form. All I get are blank fields. I think it may be a problem in the Where condition on the Open Report function.

I am using:
[Forms]![complaintentryform]

The completed form contains all data I want on the report.
I have tried printing it from the table, but I get blank fields there as well.

All suggestions cheerfully received.

View 4 Replies View Related

Cannot Print From A Form

Jan 5, 2015

I just had a problem with a certain form:On Form1, I have a check box called SELECT. When I select any one record, the report I get is blank. I need to select one more record to get a print out of the first one. To print any two, I must select those two, plus an additional one. So it is always the number required, plus one.

View 6 Replies View Related

Print Form Question?

Feb 28, 2005

I would like to have a button on a form to print the current form. Is that possible? how can this be done?

Thanks in advance!
Tim

View 2 Replies View Related

Print Button On Form.

Apr 28, 2005

Hi... being extremely new to Access, i am sitting here frustrated as anything trying to make this work. I will attempt to explain what I am trying to do.

I have a form that has a combo box in it. This combo box references a table and pulls in the data depending on the company that is selected. What I am trying to do is add a print button on the form, so that the users can print off an address label. Now I can use the normal print report feature and this prints of the entire report, but what i would really like is the print button just to print the fields I want and not the whole thing. The fields I want to print are.

Name_1
Delievery_Address_1
Delievery_Address_2
Delievery_Address_3
Postcode

Ive had a look in the event field for the print button, but I have no idea of the commands to make it only select the fields that I want to print.

I truly am lost, and seeking guidance from the masters here at Access World.

My printing problem is in your hands.... cheers Paull

View 3 Replies View Related

Can't Print Form With Tabs

Aug 15, 2005

I've been sent a form which retrieves company information divided into 4 tabbed sections. Really need to print all this off but can't even print the tab which is showing - it only prints the part of the firm outside the tabbed area (company name and number)

Would be really grateful for an idiot's guide on how to do this! Reluctant to provide a link as it's confidential information.

View 1 Replies View Related

Print Report From Form

Oct 2, 2005

I have a form which records the progress of a complaint investigation. There are 3 reports I would like to run from this form using command buttons. They are report_long (shows all activity) report_short (summary) and logsheet.
The primary key is complt#.
How do I ensure that the complaint being printed is the complt# I have on the form?

View 6 Replies View Related

Print Preview On A Form????

Feb 14, 2006

Hi All,

I have never done this and not sure if it is possible but thought I would ask.

Is it possible to show within a window maybe, a print preview of a report on a Form?

I am going to assume that the answer is no? But I could be wrong?

Look forward to anyones input on this one.:p

Robert88

View 9 Replies View Related

Print Report From Form

Mar 10, 2006

Please bear with my ramblings, but I’m not sure what you may find relevant.

I am currently doing work for a service company where the employees are required to wear the company’s uniform. When someone joins the company they are required to purchase their own uniform. After a year, the company buys the replacement uniform. Each year on the anniversary date, the employee is given their annual evaluation. At that time they are given a requisition to go to the uniform supplier for new uniform articles.

Each item in the uniform has a life span. For example, shirts and pants are replaced each year, winter coats and spring/fall coats are replaced every three years, caps every two years etc.

I have a form which lists the item no., description and cost of each item and when they are due to be replaced. For example
Winter coat last replaced on 2003/11/10, replacement date is calculated to 2006/11/10
When this employee has his evaluation this November, he will be entitled to a new winter coat. The calculations are done by clicking an option button beside the item on the form. Clicking replaces the issue date with Date() and adds three years to the issue date using DateAdd for a new replacement date. Clicking the button also indicates that the item is to be replaced.

NOW, I have all this working.

What I would like to do is find some way of printing the requisition from this form before closing it. Something along the lines of:

If Option1 is yes
Print this item on the requisition
Endif

And do this on every item on the form, if it’s yes, print it on the requisition, if its no ignore it.

The option buttons are not part of the underlying tables or query only part of the form.

If I’m doing this backwards, please let me know. I’m well ahead of my deadline.

View 1 Replies View Related

Form/Report Print

Mar 22, 2006

I have a form and the information on the form is displayed in a report so the user can print it out.

I have placed a command button on the form so that when you press the button you can print the report.

I was wondering if there was a way how i could just get it to print of the specific page i was on at the time.

Thanks for any help

View 1 Replies View Related

Print Record From Form...

Mar 9, 2005

I've got an unbound form that view records indvidually and I'd like to create a report that when the end-user selects the Print Record Command button it will print all the employees information for his review and if changes my admin's will make the changes. What code would i use to do that with a message prompting them are they sure? I also would like a cmd button to print all records for annual review. Any input will be greatly appreciated...

View 13 Replies View Related

Print Out A Copy Of A Form

Mar 14, 2008

I know how to print out a copy of a form that has no sub-forms as part of it. For those of you trying to do this, open the objects menu and click on Forms. Right click on the form you wish to print and save as a report. Open the reports menu and print the form. Suggest you eliminate colors or your ink supply will run out quickly.

Anyway, I am looking at trying to print the form with the sub-form showing as part of it. It is only for presentation purposes to show the End Users what the form will look like and ensure that all requirements are met. I could do a print screen but that only works if the form is smaller than the screen.

Any suggestions??

Thanks,
Alan

View 2 Replies View Related

How Do I Print Off Just ONE Record From A Form?

Jul 8, 2004

I have tried lots of examples but getting nowhere. Please help!

I use a form to keep a record of employees training. Form name: "ITD Data Entry"

Individuals are identified by a primary key called "SERVICE NUMBER"

I have a button on my form. When I scroll to the right record I click this button to go and preview a report, called "ITD CERTIFICATE".

My aim is to be able to just print off the record I am viewing, but at present if I select print I end up printing off all the records, which would involve a lot of paper

At present, to get around this, I have to select a print range. OK for me, but not great for a stranger to the database.

Is there a way to control this button to print preview the current record only?

Many thanks for your help in advance.

Fallyhag

View 7 Replies View Related

Form Print Update Issue

Jan 28, 2005

If anyone can i help i would greatly appreciate it. I am modifying a database at our work, which has a few forms which gives a nice summary of the current status. My upgrades to these forms included a record counter, and also a locking mechanism.
Both of these featues made use of the oncurrent() event of a form to update the view. The record counter will open a record set and display to the user a counter : RECORD x of y. The locking mechanism will lock any textboxes or controls with data in and also give them a different background colour.
My design works very well when you change between records on a form, but the moment you print the complete set of records , ie one per page, the status of the display stays the same.
The record counter freezes on the first count ,ie 1 of 39 , for all pages, and the background of the controls is not updated.

I think that an event to capture the print of each page will help, but i cant find anything to help me on that.

Thanx

PS
Sorry for the long explanation - hope somebody have the time to read and help.

View 1 Replies View Related

Form Print Previw Problem

Mar 18, 2005

I have a form that has a detail section and footer section. When I print preview the form, only the footer appears not the detail which is the data entry screen and my boss wants to print the form from print preview.

I have copies of earler stages of this database where the form was displaying completely but I have since made changes and compacted etc. Could compacting mess something up?

Suggestions would be great!

View 1 Replies View Related

Getting Data On Form To Print On Report

Dec 12, 2006

Hello,

I have a time and billing database that contains a form where the user enters a beginning date and an end date and then must enter an invoice number. All this information will appear in the header of a report. The invoice number will always be different. How can I get the invoice number to print on the report? The beginning and ending date is working just fine, but I can't get the invoice number to print. I think I need to have whatever number is entered to be temporarily stored to a table, but I am not sure at all. I would appreciate any help given.

Thanks.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved