473,320 Members | 2,112 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,320 software developers and data experts.

Email from Subform - Access 2000

Hi...

I am hoping someone can help me...

I have a subform which contains several records. One of the fields on the subform is "Email Address"

I created a command button on the main form to generate an email.

When I click on the command button, an email gets generated for the 1st record on the subform.

I am looking to have an individual email generated for each of the records on the subform. (There will be a maximum of 7 records).

Any help would be greatly appreciated.

This the code I am using:

if not isnull(forms![IssueInfo]![CallDetail].form![EMAIL ADDRESS] Then
DoCmd.SendObject _
, _
, _
, _
[EMAIL ADDRESS], _
, _
, _
"Re: " & [ISSUE DESCRIPTION], _
"Email Message Here", _
False
Sep 28 '07 #1
1 1737
nico5038
3,080 Expert 2GB
Hi...

I am hoping someone can help me...

I have a subform which contains several records. One of the fields on the subform is "Email Address"

I created a command button on the main form to generate an email.

When I click on the command button, an email gets generated for the 1st record on the subform.

I am looking to have an individual email generated for each of the records on the subform. (There will be a maximum of 7 records).

Any help would be greatly appreciated.

This the code I am using:

if not isnull(forms![IssueInfo]![CallDetail].form![EMAIL ADDRESS] Then
DoCmd.SendObject _
, _
, _
, _
[EMAIL ADDRESS], _
, _
, _
"Re: " & [ISSUE DESCRIPTION], _
"Email Message Here", _
False
For this you'll need to create a DAO processing loop for the recordset of the subform.
Use behind your email button e.g.:
Expand|Select|Wrap|Line Numbers
  1. Dim rs as DAO.Recordset
  2.  
  3. ' take a copy of the subform records
  4. set rs = Me.IssueInfo.Form.RecordsetClone
  5. if rs.eof and rs.bof then
  6.   exit sub ' no records found
  7. endif
  8. ' process the records:
  9. while not rs.eof
  10.    docmd.sendobject '.... us rs![EMAIL ADDRESS] and rs![ISSUE DESCRIPTION] where needed
  11.    rs.movenext ' goto next record
  12. wend
  13. set rs = nothing
  14.  
Getting the idea ?

Nic;o)
Oct 5 '07 #2

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

Similar topics

0
by: Josh C. | last post by:
Hello everyone. I'm a bit of an Access newbie, so please bear with me. Please go to http://www.dumoti.com/access/ to view the database - 536kb. I'll go straight into examples: In the form...
4
by: wayne dooley | last post by:
This should be easy. I have 2 tables - CUST and SUBS, which have a 1 to many relationship. I created a form to show fields from CUST and a subform to show those in SUBS. The 2 tables are related...
0
by: Sabine Oebbecke | last post by:
Hi Experts! I have several forms and reports where controls get their values with 'Forms!MainForm!Control' or 'Forms!MainForm!Subform!Control' resp 'Forms!MainForm!Subform.Form!Control' which...
1
by: BK | last post by:
Dear all, I need help with access 2000. I have a form "Child" with subform "Grand" (3 levels). I have a toggle box in every record in the lowest level of the form for status. I want to have a...
1
by: phaddock4 | last post by:
Being fairly inexperienced at Access 2000, i've been reading many posts here for the last several days, and testing myself to find the best approach to do the following in A2K: SET UP: I have...
2
by: origin197511 | last post by:
Hello all... I'm having an issue with MSAccess 2000. I have a Form that holds records of my cartridge loads for a rifle and a subform that lists all groups that have been fired with that load. ...
1
by: Marcin | last post by:
Im using MS Access 2000. i have a main form and ona subform that is scrolled vertically. unfortunately i use mouse scroll to scroll this subform. I appreciate your help
2
by: mslagle1 | last post by:
Hi all, I am trying to requery a subform "frmOpenWorkOrders" when a value list "status" on my main form "frmWorkOrderMain" is changed. If I change "status" then click on "frmOpenWorkOrders" and...
12
truthlover
by: truthlover | last post by:
I have a problem that's difficult to explain, so please be patient. The database is in 2000 format, though I'm doing most of the designing in 2007 (saved as 2000 format, of course) I have a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.