Modules & VBA :: How To Send Attachment From Current Open Record
Nov 18, 2013
What I'm try to do is attach any files from the attachment field from the current open record to email i have some code i have manage to get files from the open record to save to destination /temp folder to work so outlook can attach the files but outlook is not opening or putting them in to email also have problem's that i have highlighted in the code in red.
Code:
Private Sub cmdEmail2_Click()
Dim outlookApp As Outlook.Application
Dim outlookNamespace As NameSpace
Dim objMailItem As MailItem
Dim objFolder As MAPIFolder
Dim strAttachementPath As String
[Code] .....
View Replies
ADVERTISEMENT
Dec 4, 2013
I have 2 form, form1 and form 2 (picture attached)
In Form 1
(main form) there are "reference" field with key pressed event
then call form 2 (list of reference that user can choose)
In form 2
the problem is, when "enter" key pressed (keypress event), selection will move to next record
so the data that transferred to form 1 is wrong (next record)
The question is : how to save current record in form 2 before enter and send the data to form 1
View 3 Replies
View Related
Apr 3, 2013
Is it possible to use buttons to navigate/open attachment? I have two tables (itemTbl and ItemcomponentTbl) and a form.
Inside formare itemtbl field names (w/c include the attachment) and a componenttbl subform.
Here is my DB.
View 2 Replies
View Related
Feb 4, 2015
I have a button when pressed that it sends an email from lotus notes and inputs relevant text etc, however I seem to be struggling on how to have an attachment sent with the email. So everytime the button is pressed it will attach a word document.
View 1 Replies
View Related
Apr 6, 2014
I have some code that attaches any files that are in my attachment field on the current record in to a email this is great but I m starting to realise that this is take up way to much space as it hold a copy in the database and can t afford to go down the sql sever route so what I have done is added some new fields called path1, path2 ,path3 ,path4 and path5 now the user can add the files location to these text box instead of add them via the attachment field also I can now limit number attachments to each record
Code:
Private Sub cmdEmail2_Click()
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Dim OutlookAttach As Outlook.Attachment
Set appOutLook = CreateObject("Outlook.Application")
[Code] ....
Some how I need to change this so it checks fields path1 path2 path3 path4 path5 on the current record and see if anything is entered in these textbox's and follow the paths and attach the files to email
How to make command button . How to add a file path to a text box
1. add new field to your table e.g "path1"
2. add the new field to your form
3 create new command button call it addpath
4 add code below to click on event
Code:
Private Sub addpath_Click()
Dim fDialog As Office.FileDialog
Dim varFile As Variant
' Clear listbox contents. '
Me.Path1.Value = ""
' Set up the File Dialog. '
[Code] ....
This will now save file location path to the path1 text box. To open file path
1.add another command button call it "pathopen"
2. add code below on click event
Code:
Private Sub pathopen_Click()
Application.FollowHyperlink Me.Path1
End Sub
View 2 Replies
View Related
Feb 3, 2014
I have created a database that generates a report with customer debts. I have a lot of customers and in a report each page is a different customer with individual debts info. What i would like to do is to create a button and distribute individual report page as pdf to individual customer by email. I'm using Lotus notes. I have searched the forums i found something but it was not what i was looking for.
View 1 Replies
View Related
May 15, 2015
I have created an action log database that sends an email when a new action is entered. I would like to launch the database using a hyperlink in the email, but can't seem to get it to work. All users have a copy of the front end on their desktop, so whatever I add to the email needs to launch the front end for any user signed on to their own desktop.
This is what I have and it sends a hyperlink but I click it, I get an error saying it can't find the file. I don't know how to word the path name for any user?
With obMsg
.subject = "New action request for " & team
.To = people
[Code].....
View 14 Replies
View Related
Feb 3, 2014
I'd like a command button to open Outlook and create a new email message with the To and Subject fields already populated with what I want, is there anyway to do this?
View 1 Replies
View Related
Dec 8, 2006
I have the following code to send a email with outlook, what I need is to automatically collect a attachment named commissions located in C:document and settings/Documents/...
Private Sub cmdSendEmail_Click()
DoCmd.SendObject acSendNoObject, , , cboEmail.Value, , , "Commission Request", "A new commission request has been submitted."
End Sub
How can I do it??
Thanks
View 5 Replies
View Related
May 15, 2014
I have a database which has several records with at least 5 documents needing to be attached to each record. Using attachments or OLE would cause considerable bloat, so I opted for hyperlink fields for all the document types necessary to save with each record. However, now I am faced with an issue. It is easy enough to write code to open the files by following the hyperlinks, as well as write code to send an email, but how would I go about combining the two? I need to write a code that will attach these documents to an email, as attachments and not as hyperlinks. I know with excel documents, I could follow the hyperlink and send the document by email through excel, but I also have images converted to pdf's that need to be sent as attachments.
View 4 Replies
View Related
Apr 24, 2015
I have code that from DB1 opens DB2 and runs a Function in DB2.
The DB2 function produces a Boolean result that i am trying to get back to DB1 without success. Below is the script.
Sub Test22()
Dim AC As Object
Set AC = CreateObject("Access.Application")
rc = "K:ARSHRAutomation_ProjectsMikeFEDB2.accd b"
AC.OpenCurrentDatabase (rc)
AC.Visible = True
AC.Run "SendVariable"
End Sub
Because i am using AC.Run "SendVariable" i cant find a way to get the value of SendVariable!!
View 2 Replies
View Related
Sep 20, 2006
I have been searching the forums about how to send an email using a mail merge Word document with attachments and have not found a way to accomplish this. There are numerous posts on haw to send email using the SendObject function with attachments but I really need to use a Word mail merge to satisfy the requirements set forth by my superiors.
The database uses a query to pull the list of recipients. The query contains the name, email address and a few other informational items that need to be put in mail merge. I also need to attach a second 5 page Word document. At this point, I don’t care if I have to deal with the Outlook security or not, I only have about 20 a day to send but if there is a way to get around it, that would be cool.
Would it be possible to create a Report that looks the same as the mail merge document and send it to each of the recipients from the query and attach the document to that email?
I am running up against a deadline that is fast approaching and any help would be greatly appreciated.:(
View 1 Replies
View Related
Apr 20, 2012
I am trying to send out request-for-quote sheets to vendors and i need to send the image of the product as well. when i send emails for data collection, the attachment is not included. how can i attach images?
View 2 Replies
View Related
Aug 25, 2013
I want to add a record with attachment to a table in an access (2013) database.
If I ignore the attachment error everything works as it should, but as soon as I add the code for the attachment I receive error code 3259.
Code:
Private Sub add_tune()
Dim dbtune As DAO.Database
Dim rst_tune As DAO.Recordset
Dim rst_tune_in As DAO.Recordset
Dim rs_child As DAO.Recordset
Set dbtune = CurrentDb
[code]....
Since I have a dutch office version the error text (ongeldig veld gegevenstype) is in dutch, translated it means something like a data type mismatch.
t_first_bars is a field in the table tbl_tune . The field type is attachment.
View 6 Replies
View Related
Jul 11, 2012
I want to copy the file stored on a attachment field (.jpg), so i can use it on a Word document as a picture.
I've tried it with bookmarks but no success:
' 'Paste the photo.
.ActiveDocument.Bookmarks("EidPhoto").Select
.Selection.Text = GetPath & "RE EIDPicture" & OwnerFullName & "_eid.jpg"
Then I only get the path of the file, Is there a control that i have to use?
View 1 Replies
View Related
Jul 25, 2013
I'd like to send a query result via email attachment daily without user intervention. Is it possible?
View 3 Replies
View Related
Apr 9, 2014
I have Access 2007. I have a form where I can attach PDFs, Word documents, etc with an command button. This atachment is then put into a field in a table which has the email address and works fine.
The attachments are there in the field with the paper clip in the field title.I have a command button with an embedded macro that opens OUTLOOK and the email form with the email address and all the other information inserted perfectly. How do I get the OUTLOOK email to grab the assoiated attachment(s) from the record in the table and send them with the email? I can send the email without the attachment just fine.
The attachments cannot be located in a common path. They must be in the field in the associated record and each attachement will be different from one record to the next.
The emails are sent one by one, not as part of a group.
The form name is TASK DETAILS.
The email command buttin is called E-mail
The table is called TASKS
The attachment command buttin is called Attachments
What do I need to do this?
View 14 Replies
View Related
Feb 14, 2012
Send an email form Access code with attachment..
I am able to export data to excel file, I would like to send the excel file created to the customer, is there a sample code I can use to do this in a module.
View 1 Replies
View Related
Jan 12, 2015
I'm trying to work out how to attach a word doc to the attachment field of a table when I add a new Record. The following code work's fine if I add it to the On Load Event on the Form, but the doc is attach'd to the first record. When I add the code to the Add New Record button, I get the error msg: "File already part of the Multi-Valued Field" and nothing in the attachment field.
Code:
Private Sub Add_Record_Click()
DoCmd.GoToRecord , , acNewRec
Me.Description.SetFocus
On Error GoTo Err_AddImage
Dim db As DAO.Database
Dim rsParent As DAO.Recordset2
Dim rsChild As DAO.Recordset2
[Code]...
View 8 Replies
View Related
Jun 20, 2013
I am currently using SendObj method to send an Outlook email and selected report as an attachment using the current form's data. This is triggered by a button click.
This is working well apart from having to use 'ClickYes' to outwit the Outlook 2012 security system.
However I now need to selectively send an extra pdf file with some of the emails based on a Yes/No field on the form. This is a fixed file on my local C drive.
I think I have to use automation to do that but I can't find a method of specifying the report I currently use in the SendObj method in the .Add.Attachment line.
Do I need to run the report and then save it so that I can specify the path and name in the .Add.attachment line followed by code which will delete the file? or is there a means of combining the code I currently use in SendObj to create the pdf object with automation option?
I have working code for both attachments at present but they send separate emails and I would prefer to combine them if possible.
View 3 Replies
View Related
Feb 12, 2013
I would like to automate the current process of sending an e-mail with a PDF attachment that is unique to each recipient; it is their test results. I'm sending an e-mail one at a time (which was fine when the number of folks being tested was small, but now I'm up to approximately 200 e-mails and growing each year)
System Environment:
Windows 7 SP1 (64 bit)
Office 2010 Professional
Access environment and Process:
1. A qry object/letter is built based on 4 tables (test results, result averages, a global employee list and location)
2. The Report has both static and dynamic text. Examples include: "Dear" [qry-Letter. F_name] and Address Information
a. =[qry-Letters.F_Name] & " " & [qry-Letters.L_Name]
b. =[qry-Letters.Position]
c. ="Dept " & Right([qry-Letters.Dept],3) & ", " & [qry-Letters.City]
3. The report also includes the employee's results, the session averages (testing is conducted at multiple locations each occurrence is a session) and companywide averages.
4. Report Process: Run the report, entering primary key Emp_ID, report is populated saved (overwritten with the next Emp_ID and printed as a saved PDF.
5. MS Outlook: create a new e-mail, text body is common to all e-mails e.g. "attached are your test results" the PDF is attached and the e-mail sent to the recipient (the e-mail address follows the corporate standard, =Trim([qry-Letters.F_Name] & "." & [qry-Letters.L_Name] & "@abc.com")
View 3 Replies
View Related
May 19, 2014
I want to put a print button on my data entry form that prints the current record in a report that is laid out all nice and pretty. I found this code that works, but it goes straight to the printer - it does not bring up the printer dialog so you can select a printer.
Code:
Private Sub RecordPrint_Click()
Dim strWhere As String
If Me.Dirty Then
Me.Dirty = False
End If
[Code] ....
How do I get it to bring up the printer dialog?
View 7 Replies
View Related
May 12, 2014
I have a main form "frmDriverNoticeRecord" with 2 subforms, "frmSubDriverNotice" and "frmSubVehicleRecord"..The main form uses "IncidentID" as the PK. Each form stores data in its own table. The tables are related via IncidentID and there is a 1-many relationship between tblIncident (main) and tblDN (sub) and tblVehicle (sub).
I have a form "frmIncidentLog" displaying records in a table view with a few fields for quick reference and to allow selection of a single record for detailed viewing. I created a command button with the intent to open the "frmDriverNoticeRecord" at the current record. The main form and child link fields appear to be linked correctly; i.e. IncidentID on all three. If I open the form manually it opens and I can use it and search and filter as I want. If I try to open it via the command button It opens a small window asking for the IncidenID, when I enter theIncidentID number, it opens the form to the first record every time.Here is the code:
Private Sub comOpenDR_Click()
Dim frmName As String
Dim recID As String
frmName = "frmDriverNoticeRecord"
recID = "[IncidentID]=" & Me![IncidentID]
DoCmd.OpenForm frmName, , , recID
End Sub
I tried running the the DoCmd.OpenForm command directly from the button using the where condition (in various manners) with the same results.
View 13 Replies
View Related
Sep 11, 2013
I have a button on a FORM to print the current record with the following code:
DoCmd.RunCommand acCmdSelectRecord
DoCmd.PrintOut acSelection
But what I need is that before printing, open the preview to set the margins and page size ... or at least to pre-configure so that when you press the button, and comes preformatted.
View 2 Replies
View Related
Aug 19, 2013
I have two forms both with separate tables
(1) Register and
(2) Payments.
One of the common denominators between them is the URN which is auto-populated as it is an auto number field. My issue is that when I want to add a new record to the payments table using the forms (I can get to the payments form via the register form), I want to be able to identify the record that I am currently viewing within the register and auto populate the URN field with the same number. This is what I have done so far,
Option Compare Database
Option Explicit
Private Sub AttachPaymentDetails()
Call PerformInsert("tblFinancialBudget", "frmFinancialBudget")
End Sub
[code]....
View 5 Replies
View Related
May 6, 2015
I'm trying to make a form that shows what the last record was next to the empty space where you enter a new record.
This is so the user knows that what they are entering is roughly in line with what has come before.
So for example if I was recording temperature every May, I would like a form that has a field called temperature and next to that field I would like to see last year's temperature.
Records:
Date | Temp
2014 | 20.5
2013 | 18.5
2012 | 19.0
2011 | 22.7
2010 | 15.2
So when I enter the record for 2015 I have a box that says: Temp and next to that box is "Last year was 20.5" or something like that.
View 2 Replies
View Related