Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Groupwise Email from Access won't work more than once

Status
Not open for further replies.

KerryL

Technical User
May 7, 2001
545
US
I've created a "cmdSend" button that emails data (via Novell's Groupwise) from my database out to recipients. The cmdSend function works fine the first time I use it after launching Access, but once it's been used it will no longer send the email. In order for it to successfully send another email, I must exit Access and restart it. Then it works fine.

Anyone have any ideas? I'd be more than happy to post or email the code I'm using.

Thanks in advance or the help.

KerryL
 
Hi kerry,

Could u post the code? I have had problems similar to this (although not using Groupwise) before.

Nick
 
Here's the code for the cmdSend procedure. Thanks for trying to help out, Nick.


Code:
Private Sub cmdSend_Click()
    ' Comments  :
    '   Sends email to Contact notifying him/her that new
    '     findings have been entered into the database.
    ' Parameters:
    ' Created   : 10/12/2000 12:19 PM TRC
    ' Modified  : 09/21/2001 KBL Split FindingsEnter and
    '             FindingsReview into two forms/modules
    '             to allow for querying of existing
    '             findings
    ' --------------------------------------------------
    
'    On Error GoTo PROC_ERR
    
    Dim dbs As Database
    Dim qryEmail As QueryDef
    Dim rstEmail As DAO.Recordset
    Dim GenlInfo As GenlInfo
    Dim strTo As String
    Dim strCC As String
    Dim strMsg As String
    Dim intHeaderID As Integer
    GenlInfo = ggiGenlInfo

    'Send email notification to Contact
    DoCmd.SendObject acSendNoObject, , acFormatRTF, _
        To:=GenlInfo.ContactEmail, _
        Subject:="Procurement Card Findings (from entry screen)", _
        MessageText:=GenlInfo.I2CText, _
        EditMessage:=False
    'Update date fields
    Me.txtEmailToContactDate = Date
    MsgBox "Notice sent to: " & GenlInfo.Contact, , "Email Sent"
    cmdClose.SetFocus
    cmdSend.Visible = False
        
    DoCmd.GoToControl "cmdClose"

PROC_EXIT:
    Exit Sub
    
PROC_ERR:
    If Err.Number = 2501 Then   'user cancelled sendobject
        Resume Next
    End If
    MsgBox Err.Number & ": " & Err.Description & vbCrLf & "in Module: Form_frmDocument, Proc: cmdSend_Click"
    Resume PROC_EXIT
    
End Sub
 
Hi Kerry,

You got my attention! BTW nice code. The second time thru, does the operation fall thru to the PROC_ERR?

Also, I noticed that you hide the cmdSend Button. When do you make it visible, on the onShow Event?
 
Hello Babymaker (I really want to ask about that forum name!) :)

Thanks for the reply. Great question....I don't think I've stepped through it on the second attempt, to tell you the truth. A silly oversight on my part, I will check it out.

I hide the cmdSend button because once the info is sent, it's not supposed to be re-sent. When the email goes out a date field is filled with the current date; as the user goes through the records, the cmdSend button becomes visible for records with no date in that field. I hope that makes sense.

Thanks in advance for your help,
Kerry

 
Babymaker,

FYI, the second time I try and send an email notice it does not fall through to the proc error.

What happens is, the msg box that says "Notice sent to: [ContactName]" appears, but the email is never sent. I must close the Access pgm and re-open it before it'll work again.

BTW, when the email is sent for the first time it also asks me to choose a Groupwise profile. Once I select the Novell profile, all is well. Is there a way to add a line to the code to set the profile automatically?

TIA,
Kerry
 
Does anyone else have any ideas? I haven't heard back from Nick or Babymaker and I still can't get Access to send an email a second time without restarting the application.

Any advice will be appreciated.
 
hi Kerry - we send data from access to groupwise - email me and I will send our code to you - you may be able to adapt it.
 
Jewel,

Thank you for your offer. I'd love to look at your code that uses Groupwise to send emails directly from Access.

Please send related code to me at lehmank@michigan.gov

BTW, are you able to send multiple emails from one "Send" button using a loop sequence? Though I can get the code to successfully loop all the way through, the actual emails are not sent to anyone except the recipient of the first record. (It's driving me nuts!)

Any help or advice will be greatly appreciated. Thanks.
KerryL
 
Hi KerryL

I also use groupwise.

Can you pleas let me know if it worked?

I am going to try to adapt your original code for my database.


Ritec
 
RITec,
Unfortunately, I am still unable to get the program to successfully send a second email from anywhere inside the application.

There are two forms designed to send automatic emails, and once one is sent successfully the user must exit and restart the program in order for a second email to actually be sent successfully. If the user doesn't exit the application, he receives the "email successfully sent" message, but the email doesn't actually get mailed.

If anyone has any ideas I'd love to hear them. :)

KerryL
 
KerryL

You are still doing better than me. I am new to vba and kinda new to access too.

I also have both GroupWise and Outlook on my computer.

Everything defaults to GroupWise except this.

I need it to work in GroupWise because that is what all the other employees use.

Do you have any Idea's

[surprise]

Ritec
 
I was under the impression that using the Send command would use whatever default email program you're using. I looked around in Access to see if there was a setting somewhere but I didn't find anything.

I will surely post anything I find though.
 
Thank You for replying

I thought the same thing.

I am debating whether or not to remove outlook and try again.

 
KerryL

I am where it only works once. did Jewel's code help?


Ritec.

 
hey sorry I have been away - will be back in the office on Monday and will send you the code - but it may not help you as it is a once only send as well.

cheers
 
RITec,
I don't think I ever got the code from Jewel, and then some other things came up that were more important so I haven't worked on this for quite a while.

If you have any luck getting Groupwise to send a second email let me know. Mine is still not working either.

KerryL
 
I've tried using this code and gotten as far a having the emails I want in the To: field, but must find a way to have the mailto: removed.

Private Sub btnEmail_Click()
Dim db As Database
Dim rs As Recordset
Dim qd As QueryDef
Set db = CurrentDb

Set qd = db.querydefs!qryFilterByCampus
qd.Parameters![CustomerParam] = [Forms]![frmInstructor]![cmboCampus]
Set rs = db.OpenRecordset("qryFilterByCampus")
rs.MoveFirst

Do While rs.EOF = False
strEmail = strEmail & rs!Email & ";"
rs.MoveNext
Loop
strEmail = Left(strEmail, Len(strEmail) - 1)

DoCmd.SendObject acSendNoObject, , , , , strEmail, , , , True

End Sub
 
I am having the same problem using a macro(converted to VB code). Has anyone resolved the issue? I have 5 reports that are e-mailed at the end of the month. Access sends one report and then stops-no error. I have tried sending one at a time and found that if I waited several min. between each, I can get 2 or 3 before it stops and I have to exit Access to send the others. It appears to be a timing thing for me. Is there a "Pause" command or some other way to have the macro pause before it continues and sends additional e-mails? PS the problem seemed to start after I applied Access 2000 SR-1.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top