At present I have a tblData, a tblPeople, a long union query and a report that displays its results. On a form I select a person from tblPeople (another field on that table contains their email address), run the query and report in that person's respect and email the results to them.
What I want to do is add a button which runs some VBA code which cycles through tblPeople, runs the query for each person, works out if the query has returned any records from tblData for that person, and if so - sends them the report.
I use this to send email msgs through gmail, found it on the net somewhere, adapted a bit and it works.
Code: Private Function fSendGmail() As Boolean 'Returns True if No Errors are Generated On Error GoTo Err_ErrorHandler fSendGmail = True Const conStrPrefix As String = "http://schemas.microsoft.com/cdo/configuration/" Const conCdoSendUsingPort As Integer = 2
[Code] ....
Err_ErrorHandler: If Err.Number <> 0 Then fSendGmail = False etc, etc End Function 'fSendGmail
I'd like to send report attached to this as pdf or rtf. How should I go about it. I know how to create pdf and save it.(DoCmd.OutputTo acOutputReport, "My Report", acFormatPDF, strPath, True) But where do I attach that here? Is it necessary to save the file first?
I use a macro that attaches a document automatically to an e-mail address ready to send this report is governed by a query of which the criteria is " loss order number " this is in a pdf format of which I need if possible
The problem I have is the same pdf file keeps attaching itself to the e-mail no matter which loss order number I select. The reason I think is because the report is called NCR so it is not changing from the previous one. What I think can solve it but not sure and don't know how to do is get the " loss order number " within the report name.
If I just send the report to a file direct it does work as I am prompted for a file name
Can the loss order number get into the file name within a macro/vba
I have a VBA module in my Access 2010 database that will send a report as a PDF via email to a predetermined email address. the only problem using the docmd.sendobject method is i keep getting a pop up that says "A program is trying to send an e-mail on your behalf. If this is unexpected, click Deny and verify your antivirus software is up-to-date."
I have a windows task set up at the same time each day to open this database which runs an autoexec that creates this report and using my VBA module sends the email. i want it to just send the email without any imput from me. I want automation.
Here is my code that i am using to create and send the email
"Private Sub Report_Activate() filename = "Name of file" & Format(Me.Date_time_returned "MMDDYY") & ".pdf" DoCmd.SetWarnings False DoCmd.SendObject acSendReport, "Name of file", acFormatPDF, "the destination email address goes here",,, "Request completed and sent " & Format(Me.Date_time_returned, "MMDDYY"), "Subject of email goes here", False DoCmd.SetWarnings True End Sub"
Can you send a report directly to the printer? We have Clients with multiple Contact Notes, by multiple Clinicians, each of these are separate tables. Every month we print two reports for each client that had at least one contact in that date-range. Usually 200 clients, takes a lot of time. My approach so far is a query within a make-table query to get a list of unique client ID's that had one contact in the date-range. Then I use that table in code to create a recordset, use a Do Loop within that where I print the two reports for the 1st client, move to next record and loop. Now that I've got it working I'm not sure how to print all the reports My 1st question, can you send a report directly to the printer from code? The printer is a networked Konica Minolta Biz-hub so I think it can handle that many jobs being queued that fast.
I am using the following code (Sendobject) to create a PDF of a report and send it via email to a customer's email address.
Private Sub EmailWorkOrderQuote_Click() On Error GoTo Err_EmailWorkOrderQuote_Click Dim stDocName As String Dim mFilename As String Dim mEmailAddress As String
[Code] ....
It works fine except that the I want to to able to utilize the ability to send the email with either both the CC and BCC or either or neither as well.
I have a table called "My Company Information" that contains the email addresses for the CC and BCC. If I have values in these fields, everything works great! If I have no values in either of these fields, I get "Invalid use of Null"....
I want to be able to use either both CC and BCC, either CC or BCC, or neither used and it still work.
I have a database which has a contact table and a flight table joined in a one to many relationship. Each contact may more than 1 flight and I want to be able to report on people that have exactly the same flight pattern. For example if 2 contacts have flight records FlightID 1, 4, & 10 I want them to be grouped together.
I have tried a number of things including a cross tab query to end up with the contactID and then a string of their flight IDs but as there are over 200 possible flights, the string appears as 1,,,,,,,,3,,,,,,,,,,,,,5,,,,,,,,,,,,6,,,,, etc and when I try to group on this it doesn't seem to work. This seems a very messy way of doing it and I'm sure there must be a much easier way!
I am wondering if it is possible to send a report as xls file and keep the format exactly as the report looks.When I try to send it now, it automatically changes back to the column names from the table, which I in the report have changed and want to keep in my excel output!
I have an unbound form with an associated report. When the user hits the 'print' button on the form/screen, the report is launched in the background. In the On Load event of the report I populate the report fields from the forms field as so:
This works like a charm as long as I call the report in Print Preview mode (i.e. with acViewPreview). But if I send the report directly to the printer, none of the fields print.
I've read about using other report events to populate the fields (e.g., On Format and On Print) and also something about using TempVars to pass the data. But I haven't read anything that's clear and definitive about the full answer.
Im new to access and i have a problem!! I have a report that i need to be sent out monthly to 3 people. The problem is i dont know where to start. I have been looking through the forum, but nothing that i can get my head around, so there anyone out there who can help???????
I am trying to send an MS Access 'report' as an attachment to a mail recipient in rtf format without success. Everything seems to work fine except the 'send' button. Click away and nothing happens.... no error messages, no nothing. Any suggestions or tips on how to make this work?
I want to sent out my report as a pdf file with my macro.. I've been trying to use the VBA
Code: Option Compare Database
Sub Fix1() DoCmd.SendObject acSendReport, "MarketRiskControl_HighestDiffs_AsOfCurrentDate", "PDFFormat(*.pdf)", "my mail@mail", "cc", , "SD Counterparty Report as of Current Date", "Regards, Trading Risk Control", False End Sub
How to create a new folder through the MkDir function, but my problem is, I then need my report to go to the new folder I just created.
For example: the path is = "VAIOUsersDocumentsTownship" & Me.[Owner Name].Value
When I try to send the report there.. it only goes to "VAIOUsersDocumentsTownship" and not the new folder created titled with the owner name... the Me.[Owner Name].Value ends up getting set as the name of my report, in addition to the report name which is defined as the number.
My actual code is listed below:
Private Sub cmdFileReceipt_Click() Dim strMyPath As String If Me.cboMun.Value = "C-Town" Then strMyPath = "VAIOUsersDocumentsC-Town" & Me.[Owner Name].Value
Ok I saw this posted up in the forum but it was not explained.
I have a Query which asks for a parameter before giving an output.
I have a report that uses this query to display the information.
Ok what I am trying to do is create a form that has a textbox and I enter the parameter's information in that textbox or textbox. How do I send the information to the query?
The reason for such a thing is people tend to not follow the set guidelines for putting stuff in a parameter box. So what I decided to do was set up a calendar form which a person has to physically choose the date from the calendar and this leaves no room for real error. My problem is I can get the calendar information to the textbox or textboxes but can't figure out how to code the button to send the textbox information to the query & parameters & report, etc...
Can someone please help me out of this situation? or point me to a starting point?
Could you please help me and advise if it's possible to send report from MS Access by mail - having report as a content of an e-mail instead of attachement?
In Access 2007 there a way to send a report to a file you create from the information in the form?
Right now my code for the command button is:
Dim strMyPath As String Dim strMyName As String strMyPath =" EBEBMainDigital Sender " strMyName = "Permit " & Me.[Permit Number].Value DoCmd.OpenReport "File Current Permit", acViewPreview, , "[ID] = " & Me.[ID] DoCmd.OutputTo acOutputReport, "File Current Permit", acFormatPDF, strMyPath + strMyName, False DoCmd.Close acReport, "File Current Permit"
And that works perfect for sending the current report to the Digital Sender Folder... but I'd like to be able to send it to a certain county folder within the digital sender folder, based on what is listed for the county on the form. same for municipalities. and then, have it create a folder based on the name inside the form..... how to lead it through the path of the folder through the given information on the form, or how to make it create a folder.
I like this form I have that allows me to send attachment when email is entered.However, I would like to have a list box of Name and Email Address. when selected the email address is now set (same as before but just as a drop down) I type my message etc...But the attachment part I would like to send a specific report (that connects to that email address) so that it will only send jobs connected to that person.
Here is the code below:
Private Sub Email_Output_Click() ' ' Email API Outlook example programming code ' Send email from to Outlook ' Select Case Me.Email_Output_Option
Send only one or two pages of a multi-page report. I have a report that has three pages. I only want to send the first two as a pdf file. Can this be done with VBA? I know it can be done using Exporting Data on the External Data ribbon, but how can I do it via VBA?
The query Q_CurrentJobs is a list of jobs to send to the tech for today. (These are open jobs queried).
I need to run this query on the report (R_CurrentJObs) and send the report to each tech based on their individual jobs. The jobs are connected to each tech by its TechID.
The report list the job information for each tech (JOb number, Location details etc.)
When I click the button to send the email. I want to email each tech individually based on the Q_CurrentJobs query using R_CurrentJobs. (DoCmd.SendObject)
In a form I have a button which creates (in preview) an outlook message with a pdf report. It opens and displays just as I want it to, but if I chose to save that message in outlook and either send or cancel (i.e. allowing user to save to drafts and send later) then MS Access crashes.To ensure this wasn't to do with any compile / corruption within my full application I mirrored the process in a very simple 1 table / 1 form / 1 report db and still the same - access crashes after saving the outlook message and either sending the message or cancelling out the message.
Form code is as follows;Private Sub Command0_Click() On Error Resume Next DoCmd.SendObject acSendReport, "Table1", acFormatPDF, "someemaddress", , , , "REQUEST FOR INFORMATION" DoEvents On Error GoTo 0 End Sub
In my main application this process is embedded within a loop to send various filters of the report to different recipients, which works fine if 'save' is not used within Outlook..
I have a project which produces a report of names, addresses, etc. I added a print button to the form to send the report to the printer. The code is as follows:
Private Sub Command32_Click() Docmd.SetWarnings False 'Docmd.OpenReport "rptAddresses", acViewNormal Docmd.RunCommand acCmdPrint Docmd.SetWarnings True End Sub
Both alternatives in the code produce the same result described following.However, the printed report includes only the first 2 colums of about 10 of the 90 plus records. If I send to to a PDF, it works fine. If I do a print view on the screen ir looks fine.