473,399 Members | 3,919 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,399 software developers and data experts.

Need to generate text list with email address

Hello everybody

First of all, I'm very new in MS Access.
I have a table to store data about people.
The fields are Name, Surname, e-mail, address, phone, and so on.

I need to generate a comma-separated text file with a list of e-mail addresses.
For example:

Record1: Name1, Surname1, email1@aaa.com, phone1....
Record2: Name2, Surname2, email2@aaa.com, phone2....
Record3: Name3, Surname3, email3@aaa.com, phone3....
.....
Record-n: Name-n, Surname-n, email-n@aaa.com, phone-n....

The output should be a text file like this:

email1@aaa.com,email2@aaa.com,email3@aaa.com,..... email-n@aaa.com

Is there any way to do this?

Thanks in advance,
Pablo
Sep 30 '06 #1
2 1440
PEB
1,418 Expert 1GB
Hi,

Save this function in a module
Expand|Select|Wrap|Line Numbers
  1. Function create_field(SQL, file_name)
  2. Dim mydb as database
  3. dim myr as recordset
  4. dim res
  5. set mydb as currentdb()
  6. set myr as recordset
  7. myr.movefirst
  8. Do while not myr.eof
  9. if res="" then
  10. res=myr(0)
  11. else
  12. res=res+", "+myr(0)
  13. end if
  14. loop
  15.  
  16. open file_name for output as #1
  17. Print #1, res
  18. Close #1
  19. myr.close
  20. mydb.close
  21. END function
  22.  
Then create a macro runcode in which supply: create_field("Your query name", "Path and file name")

Your query with the mail have to have only one column - the column with the mails!

Best regards!

:)
Sep 30 '06 #2
pgirl
13
Or click on File -> Export and choose csv from the file types list.

You can click on the ADVANCED button to set more options.

This will put each record on a new line and seperate each field value with a comma.
Oct 2 '06 #3

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

Similar topics

0
by: Valerie Smith | last post by:
Hi, I am looking for an email address management software package that can do the following: 1. Mail Merging / Demerging capabilities... a). I will be adding to my list of email addressses...
5
by: news | last post by:
I have a new situation I'm facing and could use a suggestion or two, as I don't seem to be able to think in the abstract very well. We have a local server which holds all of our image files. We...
9
by: Brian Hampson | last post by:
I am trying to determine all the groups which the current user has permissions to add a member. Here's my code: foreach (System.DirectoryServices.SearchResult ADSearchres in...
2
by: CM | last post by:
Hi, Could anyone please help me? I am completing my Master's Degree and need to reproduce a Webpage in Word. Aspects of the page are lost and some of the text goes. I would really appreciate it....
2
by: Hexman | last post by:
Hello All, I'm nearing the end of my current project and the users came up with 2 more requests. I'll talk about the first one in this message. I've developed (with much help from this group)...
4
by: Gandalf | last post by:
Hi every one. I need comprehensive tutorial for the following library : 1. pyWinAuto 2. winGuiAuto Thanks in advance
10
by: Dutchmarshalls | last post by:
Hi All, I'm using a Pay Pal form script, but locally tested in Dreamweaver with a browser it will do exactly what I'm aspect it to do. Only when I'm uploaded the file on the server it will give...
23
by: Geoff Cox | last post by:
Hello, Is it possible to use php to generate different menus for users who have access to files in different folders? For example, user Fred might be able to access files in folders A, B and...
1
by: deepaks85 | last post by:
Dear All, I want to send some data through a form with Multiple attachment in an HTML Format. I have tried it but it is not working for me. I am able to send data without attachment but with the...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.