473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Each Record in Access report Should go as mail to the email specified in report

I have a report which contains Employee Code,Name and E-Mail Address.
I want auto generating button next to each row.
Which will email record only in that row to the email id specified in that row.
Oct 28 '13 #1

✓ answered by topher23

Whoops! I noted that problem previously and thought I'd already fixed it on the blog post. The function calls another function that it uses to iterate adding attachments based on the number of semicolons in the string. Here's the other function that you'll need to paste into the module with the SendSMTP function:
Expand|Select|Wrap|Line Numbers
  1. Public Function CountInStr(StringToCheck As String, StringToFind As String) As Long
  2.     CountInStr = (Len(StringToCheck) - Len(Replace(StringToCheck, StringToFind, ""))) / Len(StringToFind)
  3. End Function
  4.  

5 1103
topher23
234 Expert 100+
Okay, here's what you do.
1. Put a command button in the detail section of your report. You probably want to set the "Display When" property to "Screen Only," so it doesn't show up if you print your report.
2. If you use Outlook in your company, you can use Outlook Automation methodology to send your email. If you don't want to rely on Outlook, check out my post about using SMTP via GMail.
3. If you decide to import my SendSMTP function, the only code you need in your command button will look like this:
Expand|Select|Wrap|Line Numbers
  1. SendSMTP Me.[EmployeeEmail], "[Your Subject line]", "Some body text " & Me.[Field1] & "; " & me.[Field2] 
If you go with Outlook automation, you'll apply the same concept with the Outlook syntax instead.
Oct 28 '13 #2
thanks for reply topher23 i tried ur function but Its throwing error "sub or function not defined"
Oct 29 '13 #3
topher23
234 Expert 100+
Whoops! I noted that problem previously and thought I'd already fixed it on the blog post. The function calls another function that it uses to iterate adding attachments based on the number of semicolons in the string. Here's the other function that you'll need to paste into the module with the SendSMTP function:
Expand|Select|Wrap|Line Numbers
  1. Public Function CountInStr(StringToCheck As String, StringToFind As String) As Long
  2.     CountInStr = (Len(StringToCheck) - Len(Replace(StringToCheck, StringToFind, ""))) / Len(StringToFind)
  3. End Function
  4.  
Oct 29 '13 #4
thanks topher23 it works like champ
Oct 29 '13 #5
topher23
234 Expert 100+
always happy to help!
Oct 29 '13 #6

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

Similar topics

4
by: Joe User | last post by:
Hi all....I have a feeling this is going to be one of those twisted query questions, but here it goes anyways.... I want to generate a report that shows the chronology of events (represented by...
1
by: Ronnie | last post by:
Newbie question - I am currently able to email a report from Access. However, the report will contain all of the records in the database and not the single record I clicked on to send via...
20
by: Greg | last post by:
I'm fairly new to access (using 2002) and am setting up a DB for work. along with each record the user also needs to make a flow diagram (previously, these reports were composed in word and they...
2
by: Will | last post by:
I am trying to send a report by email using DoCmd.SendObject acSendReport. When I send the report, it sends the report with all the records whereas I only want the report to show one record. I...
9
by: MLH | last post by:
I have a source query (qryITSLetterList) feeding rows containing name, addr, city, state, zip and VehicleID to a report (rptITSnotices). The query may contain 1-to-5 records resulting in 1-to-5...
3
by: kevinj | last post by:
Greetings, I am creating a "stoplight" type report that is based on the number of days between dates, the field will be highlighted in red, yellow, or green. I am able to change the background...
4
by: QntmPg | last post by:
Hi all, I have read through what I could find on previous questions regarding using the OpenArgs property, but I'm still not able to get my form to open correctly. I'm not sure exactly where the...
0
by: jon huff | last post by:
Here is what I am trying to do - i have a report in MS access called "DocProcurement". it is based off of a query. the query can have many records in it. the report shows all records from the...
1
by: axkoam | last post by:
Microsoft Access 2007. Background: I have a query that received work orders from out client system and runs them through access. Once in Access, an employee goes through the query output and...
5
by: jbrown8253 | last post by:
Microsoft Access 2007 Export Report for each record within a recordset I am attempting to click a button on a form that will export a report that is unique to each record. I created a query that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.