[AccessD] Docmd.SendObject

Dan Waters dwaters at usinternet.com
Thu May 1 13:30:14 CDT 2008


In your code below, you are not sending an object, just an email with a
subject line and a message.  So, remove the object format of acFormatHTML.
Also, remove the apostrophes from around the word Stock in your subject
line.

Change your variable 
	dim Body
	
	To
	
	dim stgBody as String  

The word Body related to email is likely to be a Key word.  Using key words
as variables in code DOES lead to strange results.  (I found out once that
the word Note is a Key word and couldn't use it in an Insert statement.)

I would also suggest explicitly setting the Stock, StockPercent, and Body
variables.

HTH,
Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
Sent: Thursday, May 01, 2008 12:02 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Docmd.SendObject


Here is the email function...it steps right through as if everything is
OK...bot No email gets sent on the SendObject...and no errors either.

**********************************
    Dim dbs As Database, rst As Recordset, intI As Integer, FirstCount As
Integer
    
    Dim Stock
    Dim StockPercent
    Dim Body
    Dim strNumber As String
        Set dbs = CurrentDb
    Set rst = dbs.OpenRecordset("My SQL Statement here")

        FirstCount = rst.RecordCount
        rst.MoveLast
        rst.MoveFirst
    For intI = 1 To rst.RecordCount
     Stock = rst!symbol
     StockPercent = rst!PerChange
    Body = Body & Stock & ":" & StockPercent & " "
        rst.MoveNext
        
        Next intI

         rst.Close

    Set dbs = Nothing

DoCmd.SendObject , , acFormatHTML, "5555555555 at messaging.sprintpcs.com",
"6666666666 at messaging.sprintpcs.com", , "Stock", Body, 0

**********************************


> From: dwaters at usinternet.com
> To: accessd at databaseadvisors.com
> Date: Thu, 1 May 2008 11:04:55 -0500
> Subject: Re: [AccessD] Docmd.SendObject
>
> Mark - can you post some of your code and show which line(s) get skipped
> when you are stepping through?
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
> Sent: Thursday, May 01, 2008 7:40 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Docmd.SendObject
>
>
> Thanks Max,
>
> But ...No. I think It has something to do with the checking for the FTP
and
> not finding one(or some code in between). If it does not find a file...it
> never gets to the email part...so I'm not sure where it would impact.
>
> Currently If I run just the email part...runs fine...over and over
> again...but if I let it step through the FTP and other stuff...it will run
> if it finds a file...if no file...I can not even run just the email part.
> It steps through as if everything is OK...just no email. There is error
> handling, but NO error?
>
> Thanks,
>
> Mark A. Matte
>
>
>
>
>
>> From: max.wanadoo at gmail.com
>> To: accessd at databaseadvisors.com
>> Date: Thu, 1 May 2008 07:26:15 +0100
>> Subject: Re: [AccessD] Docmd.SendObject
>>
>> Is the PC set to Hibernate perhaps?
>> Just guessing really.
>> Max
>>
>>
>> -----Original Message-----
>> From: accessd-bounces at databaseadvisors.com
>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
>> Sent: Thursday, May 01, 2008 2:06 AM
>> To: Access Developers discussion and problem solving
>> Subject: [AccessD] Docmd.SendObject
>>
>>
>> Hello All,
>>
>> I have an MDB that does some FTP,Unzip,Import, and email.
>>
>> Its been running a few years...but recently put it on a newer
>> machine...running 2000 Server...A2K.
>>
>> All of the functionality still works...at first...
>>
>> It is using a form timer to check for a file...and when it finds 1...it
> does
>> all the other stuff.
>>
>> Problem is after an hour or so...it stops sending email. It does not
>> error...if I go and step through the whole thing...or just the email
>> part...it just steps right over the docmd.sendobject without erroring. If
> I
>> reopen the mdb...it runs fine for a bit...b ut same issue comes up?
>>
>>
>> Any ideas?
>>
>> Thanks,
>>
>> Mark A. Matte
>> _________________________________________________________________
>> In a rush? Get real-time answers with Windows Live Messenger.
>>
>
http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh
>> _realtime_042008
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>
> _________________________________________________________________
> Back to work after baby-how do you know when you're ready?
>
http://lifestyle.msn.com/familyandparenting/articleNW.aspx?cp-documentid=579
> 7498&ocid=T067MSN40A0701A
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com

_________________________________________________________________
Spell a grand slam in this game where word skill meets World Series. Get in
the game.
http://club.live.com/word_slugger.aspx?icid=word_slugger_wlhm_admod_april08
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list