PC Review


Reply
Thread Tools Rate Thread

Confusing result

 
 
=?Utf-8?B?SmVmZiBD?=
Guest
Posts: n/a
 
      2nd May 2006
I am trying to get the following to run:
Dim Directors As ADODB.Recordset

Set Directors = New ADODB.Recordset

Directors.Open "tbl_Directors", CurrentProject.Connection, adOpenStatic

Do Until Directors.EOF

[Forms]![frm_SendReport].[Director].Value = Directors![Employee Full Name]
[Forms]![frm_SendReport].[Jeff].Value = Directors![Jeff]

DoCmd.SendObject acSendReport, "rpt_ApplicationAccess", acFormatTXT,
[Forms]![frm_SendReport].[Jeff], , , "SOX 404 Appropriate Application Access
Review", "Please review the attached report, electronically sign and return
to sender.", True

Directors.MoveNext

Loop

The report is based on a query with criteria in the field [employee full
name]"

[Forms]![frm_sendreport].[Director], which is the combo box that selects the
Director from tbl_Directors.

Two things happen: Some directors get empty reports so in the noData event
of the report I entered cancel = true, this cancels the sequence entirely
after the first report is sent.

I then look in the Directors table and a new empty record has been added.

Can anyone help with this? What am I missing? Thank you.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmVmZiBD?=
Guest
Posts: n/a
 
      2nd May 2006
Evidently because my form had as it's record source the table I was using as
the record set, this is what was creating the new records everytime the code
ran. I converted the for to unbound and am using unbound text boxes to hold
the email address and name of director. Now the mailing works.

I am still stuck with the "Cancel = true" on the report's on no data event.
With this in place the loop ends with an error after the first email.

How can I get the loop to skip empty reports if this is not the correct way?

Thanks.

"Jeff C" wrote:

> I am trying to get the following to run:
> Dim Directors As ADODB.Recordset
>
> Set Directors = New ADODB.Recordset
>
> Directors.Open "tbl_Directors", CurrentProject.Connection, adOpenStatic
>
> Do Until Directors.EOF
>
> [Forms]![frm_SendReport].[Director].Value = Directors![Employee Full Name]
> [Forms]![frm_SendReport].[Jeff].Value = Directors![Jeff]
>
> DoCmd.SendObject acSendReport, "rpt_ApplicationAccess", acFormatTXT,
> [Forms]![frm_SendReport].[Jeff], , , "SOX 404 Appropriate Application Access
> Review", "Please review the attached report, electronically sign and return
> to sender.", True
>
> Directors.MoveNext
>
> Loop
>
> The report is based on a query with criteria in the field [employee full
> name]"
>
> [Forms]![frm_sendreport].[Director], which is the combo box that selects the
> Director from tbl_Directors.
>
> Two things happen: Some directors get empty reports so in the noData event
> of the report I entered cancel = true, this cancels the sequence entirely
> after the first report is sent.
>
> I then look in the Directors table and a new empty record has been added.
>
> Can anyone help with this? What am I missing? Thank you.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
display a qry result in a form, select from the result & write out Brian Beardmore Microsoft Access Forms 0 16th Feb 2009 11:04 PM
RE: excel result return wrong calcuation result =?Utf-8?B?cGF1bA==?= Microsoft Excel Worksheet Functions 0 14th Aug 2006 11:14 AM
Creating database result view in Frontpage, result is truncated at 256 - need to expand Beefminator Microsoft Frontpage 1 3rd Jun 2006 09:54 AM
Advanced formula - Return result & Show Cell Reference of result =?Utf-8?B?SXJ2?= Microsoft Excel Worksheet Functions 7 6th May 2006 03:36 AM
vlookup based on random result returns incorrect result =?Utf-8?B?cmlja2F0?= Microsoft Excel Worksheet Functions 1 6th Dec 2005 01:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:14 AM.