Modules & VBA :: Sending A Single Email To A Single Record In A Query

May 15, 2014

I am trying to create a form with a button attached to each record that would allow the user to click the button and it would automatically open outlook and fill in the TO:, SUBJECT: and BODY: fields. Here is the code that I currently have:

Code:
Private Sub Command33_Click()
Dim strEmail As String
Dim strMsg As String
Dim oLook As Object
Dim oMail As Object
Set oLook = CreateObject("Outlook.Application")
Set oMail = oLook.CreateItem(0)

[code]...

There are two issues I keep running into:

1. This code opens outlook and populates all of the fields but pastes the email incorrectly. Instead of pasting just the email (email@email.com) it pastes the html tags as well (email@email.com#mailto:email@email.com#) which means that the user would have to delete everything between the #'s in order to send the email every time.

2. I currently have the email BODY pulling from a table but this obviously limits what I can do. I would like to simply encode the BODY within the VBA code. The setup I am looking for is:
one paragraph
a blank line
a hyperlink to a website
a blank line
another paragraph

View Replies


ADVERTISEMENT

Modules & VBA :: Storing A Single Record In A Single Dimension Array?

Sep 8, 2014

Any Single line of code available?

View 2 Replies View Related

General :: How To Send A Single Email Message To All The Email Addresses In Query

Jun 2, 2014

I have a query (Access 2007) that contains a field named "email" (which contains email addresses, of course). I want to email everyone in the query and they are all going to receive the same message. My email to them doesn't have to be personalized and I don't need to collect data from the recipients. I don't even need a reply to the email I send.

View 12 Replies View Related

Email Single Record In Form (Hayley Baxter Help Plzz)

Jul 21, 2005

Hi,

I have searched this forum and found a few examples but cannot get them to work in Access 97, what i would like to do is email a single record by using a query for Repair No..

So i would like it to be a button, it's possible to do this via a sendOject command but that emails ALL records not give a option to type in your repair number and email that...

Thanks for any one who can help, im a complete noob an dneed some help

View 7 Replies View Related

Modules & VBA :: Send Single Email To Multiple Recipients?

Jul 31, 2013

What is the best way to send a single email to multiple recipients?

View 14 Replies View Related

Modules & VBA :: Mail Merge For Single Record

Feb 18, 2015

I have an access .adp project which is linked to a sql server tables (2008 r2), I have a button on an access form which I click and successfully gets customer details based on a query. What I wanted to know is when I am viewing a specific record i.e. details for Patient Number X, when I click on a mail merge button from their record form can the mail merge document only open with their details not all customers?

I have tried to delve into vba and modules to acheive this but I am a newbie.

View 4 Replies View Related

Modules & VBA :: Export Single Record To MS Word Template

May 25, 2015

I am working in Access 2013.I'll be performing a series of inspections at a number of intersections for a small community. The data being captured is consistent from site to site and lends itself to a database application, and what I would like to do is the following:Use forms to capture the data.Generate a report to preview the output for a single record. I may ultimately decide to set the report datasource to a query.Attach a macro to a button that exports fields from that record to a template based in MS Word.The first two bullet items I can handle with my limited Access capability. Each file has to be individually reviewed and saved, and each file will ultimately contain an electronic signature.

View 2 Replies View Related

Modules & VBA :: Saving Single Record In Form As PDF In Access 2013?

Jul 3, 2013

I need to save a single record (preferably the current record) as a PDF. I have created a form for my boss to calculate bids. He wants to save each record individually as a PDF to upload into our service software program to attach to client files. I can save a selected record as a PDF if I print the selected record first. We need to eliminate having to print it first as it is just a waste of paper and an unnecessary step. I am kind of thinking that VBA and attaching that to a control button on the form is the way to go, but I am new to writing code and I am completely confused!

View 7 Replies View Related

Max Value For A Single Date/multiple Time/single Tag ID Combination

Oct 18, 2007

Hi, thanks in advance for any help you can offer. I've got a table that has

Date
Time
Tag ID
Power Level

throughout the day a computer listens to several tags (transmitters) and records the power level of the signal generated by the tag each 3 seconds. What I'd like to do is build a query that gives the Date, Time and Maximum Power level reading for each tag ID. I only want 1 record per tag per day

I've tried using "group by" and max in the query but this gives me all the times throughout the day.

anyway, thanks again for looking

cheers, Shaun

View 2 Replies View Related

Append Query - Single Record

May 18, 2005

Hi,
I am trying to run an append query, but instead of appending the whole table, I would like to only append a single record.

I have an append query, and it works like a charm. I can also get it to work with prompting the user for a parameter (in my case LeaseId which is a primary key). When the user is prompted and enters the LeaseId it only appends the single matching record. Works like a charm.

However, I don't want to prompt the user for the paramater. I want the user to generate the LeaseId based on the selections in two combo boxes.

So far the I do get the right LeaseId, but I have no idea how to actually pass the LeaseId to the query. I've tried the following, but I know it's completely wrong.


stDocName = "approveLease"
DoCmd.OpenQuery stDocName, acNormal, acEdit, "[LeaseId]=" & Me.buildingCombo.Column(0)


Any ideas on how to actually accomplish this?

View 12 Replies View Related

Modules & VBA :: Sending Reports By Email Based On A Query

May 13, 2015

I am trying to send a report to a list of employees. I have a query that generates the report into the layout I want and includes the e-mail address of who the recipient should be. The report looks something like this:

--Employee Name--
--E-mail address---
-Hire Date----Tenure-
-Attendance-
-Quality Score-
...etc...

I need to send, for each row in the query, this report based on the results of that particular row. How would I go about making a e-mail template that would be used, or at least sending the report as a PDF attachment? I've seen the sendObject method.

View 1 Replies View Related

Add Single Record To A Table Using Append Query With One To Many Relationship

Nov 21, 2014

I have tables Account (PK acctnum) and Orders (linked via acctnum to Account). There are multiple orders per account that need to be billed individually. When creating an invoice I need to add the Account to the Invoice table and the Orders to the InvoiceDetail table. I use 2 queries to accomplish this. The first one though adds multiple records to the invoice table (because of the one to many relationship). I need to keep that so I don't bill anyone with no orders.

INSERT INTO Invoices ( InvoiceDate, AcctNum )
SELECT DISTINCT Date() AS InvoiceDate, Account.AcctNum
FROM Account INNER JOIN [Order] ON Account.AcctNum = Order.AcctNum
WHERE (((Order.OrderNum)=[Forms]![Account]![Order].[Form]![OrderNum]) AND ((Account.BillingCycle)="on discharge") AND ((Order.EndDate) Is Not Null) AND ((Order.Closed)=Yes) AND ((Order.PatientName)=[Forms]![Account]![Order].[Form]![PatientName]));

Is there any way to get it to only add one record? I've tried limiting it with several parameters to no avail.

View 2 Replies View Related

Embedding Single Page From Report In An Email

Mar 5, 2006

Hi

From advice I have read on here I have worked out how to create a button on a form which opens a report to show the values which match the record open on the form. It then attaches that page as a txt file to an email. Which is great.

What I would like it to do though is insert into the body text of the email the text from the report. Have looked as much as I can at the properties of DoCmd.SendObject acSendReport but cannot achieve this myself.

What I have is pretty much this:
Code:DoCmd.SendObject acSendReport, "Your matching details this week", acFormatTXT, Me!PersonEmail, , , "Details this week " & Date, "Please see the attached text file for details this week which match your selection criteria.", False

How can I make the text appear within the email body?

View 14 Replies View Related

Modules & VBA :: How To Stop Email Sending If Output Query Is Null

Nov 12, 2014

Any code that stops the vba from running if an 'output to' function is null. I've found some code using the DCount function but I'm struggling to adapt this to multiple excel outputs.

I'm sending 5 excel files via E mail to several addresses and I'm wanting to identify if the first file has records, currently using access 2010.

View 5 Replies View Related

Query In Forms Question (printing A Single Selected Query Record From A Form?)

Oct 19, 2004

What is the best way to impliment a query in a form so that the user can view the query records, and have the option to print or save the selected record using command buttons?

I tried subforms but I could not get the command buttons to work in the subform after it went into the form, it wanted to print the entire form instead of the selected record from the subform.

So in a nutshell I have 3-4 queries that are built, and I want to have them show up on my form in a format that the user can scroll through the results and select a single record of the results and then print or save that individual record from the form, if such a thing is possible.

Thanks in advance

Todd

View 1 Replies View Related

Modules & VBA :: Specifying Email Address When Sending Email Via SMTP

Jan 19, 2015

I am currently using vb code to send an email in Access on the click of a button. I want the database user to be able to enter the recipient in a text box [ToEmail] which is on form [GroupStockProfiler]. However, I'm unsure how to put this into my code. I currently have the following which doesn't work (unless I put a specific email after 'To'):

Private Sub Command414_Click()
Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2
Const cdoAnonymous = 0

[code]...

View 1 Replies View Related

Queries :: Press A Button And Run A Macro / Append Query To Add A Single Summary Record To Another Table

Aug 2, 2013

I have a query run that gives me a list of records that I view on a continuos form. What I want is to press a button and run a macro/Append Query to add a Single Summary record to another table.

For example my query spits out this data

Part # Quantity Serial Number
GO2 1 123
GO2 2 456
GO2 2 789

What I'm looking to get is

Part Number Total Quantity Serial Number 1 Serial Number 2 ..
GO2 5 123 456

I'm stuck on a couple of things.

1. Getting a new single row to append.
2. Getting Serial Numbers from several records to save on to a single record.

View 4 Replies View Related

Modules & VBA :: Store Entire Query (single Field) In Array And Check Its Values

Mar 12, 2014

Basically, what's the best practice or how do we store a query's value into an array then checking what the max or min value is and how to check if let's say "4" is in the array?

View 1 Replies View Related

Modules & VBA :: Generate Multiple Records In One Table From Single Record In Another Table

Sep 20, 2014

I am building a simplified re-order point system - if inventory position drops below a certain level (the yellow level is this case) one or more purchase order lines has to be created in another table.

I have one table with the following field and data:

ItemId Red Yellow Green Multiple Inventory position
0001 10 30 50 5 45
0002 5 40 47 5 23
0003 11 20 30 10 5

I would like to generate new records (in another table) based on the above fields and three records.Basically the end result should look as the following:

ItemId Qty Start inv Aggregated inventory Prioritization
0002 5 23 28 Yellow
0002 5 28 33 Yellow
0002 5 33 38 Yellow
0002 5 38 43 Green
0002 5 43 48 Green
0003 10 5 15 Red
0003 10 15 25 Yellow
0003 10 25 35 Green

The logic is quite simple - if inventory position is less than the yellow value new order lines should be created in multiple qty (based on the multiple field) until the aggregated value (in table 2) is above the green value.The priotization value should be based on the start inv (in tbl 2) compared to the values in red, yellow and green in tbl 1.

View 8 Replies View Related

Single Record In Table

Feb 22, 2007

Hi,

On our main menu table, I only want to be able to add one record.

On the form that I have linked to this table, should you press the tab key to go through all the items / buttons, it opens a blank record screen. However, I do not want this. Any ideas?

Thanks in advance

Lee

View 2 Replies View Related

Adding Single Record

Sep 5, 2005

I have 2 tables and a query to show the details of both tables on a form for an attendance database. The idea is that whenever someone is absent they have a record created.

tbl[Staff] has the following fields StaffID,Name,Team,Job Title
tbl[Absence] has the following fields StaffID, abStartDate,abEndDate,abIssue

I can set up the query to find the member of staff by name but I want to be able to use this form to add new records to the Absence table for each individual. eg I use the query to search for "Joe Bloggs" and the form shows the details from staff table and then use the form to add details to the Absence table.

Any help would be greatly appreciated

View 2 Replies View Related

Adding A Single Record

Sep 5, 2005

I have 2 tables and a query to show the details of both tables on a form for an attendance database. The idea is that whenever someone is absent they have a record created.

tbl[Staff] has the following fields StaffID,Name,Team,Job Title
tbl[Absence] has the following fields StaffID, abStartDate,abEndDate,abIssue

I can set up the query to find the member of staff by name but I want to be able to use this form to add new records to the Absence table for each individual. eg I use the query to search for "Joe Bloggs" and the form shows the details from staff table and then use the form to add details to the Absence table.

Any help would be greatly appreciated

View 2 Replies View Related

Modules & VBA :: Sending Email With Or Without Attachments

Jan 12, 2015

I'm working on a database for work that email's the current record after the form is completed. I have a attachment field in the table called Photo and some record's have a photo attached and other's don't. The code below works great with records that have a photo attached, but I get a path not found if I try to email a record that does not have a photo. I know that I need to put some form of code to check the photo field for a attachment, but I'm having a brain fade as to just what the code is.

Code:
Private Sub eMail_Report_Click()
Dim oFilesys, oTxtStream As Object
Dim txtHTML As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem

[Code] ....

View 5 Replies View Related

Modules & VBA :: Sending Email With PDF Attachment

Dec 16, 2014

i am trying to send a email with a pdf-report attached based on a report (rap_factuur_klant_pdf).I am using MS Access 2007 and Outlook 2007..

Code:
Dim sAddr As String, sSubj As String, sFor As String
Again:
sAddr = InputBox("E-mail address:")
sSubj = "Report"
sFor = Left(sAddr, InStr(1, sAddr, "@") - 1)
DoCmd.SendObject acSendReport, rap_factuur_klant_pdf, acFormatPDF, sAddr, , , sSubj, "BLA BLA BLA"
DoEvents

View 5 Replies View Related

Modules & VBA :: Sending Out Automate Email

Jun 25, 2013

I use a macro (SendObject), which works, but it requires Us, or someone to go into Outlook to click on send.I'm new to vba, do I have to code something on outlook to send automatically?

View 6 Replies View Related

Modules & VBA :: Display Email Before Sending It

Nov 13, 2013

I have this code below in order to send query through outlook. How can I display the mail and not directly sending it?

Private Sub Command64_Click()
Dim message As String
Dim rs As Recordset
Dim vRecipientList As String
Dim vMsg As String
Dim vSubject As String

[Code] .....

View 5 Replies View Related







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