problem

dino

Registered User.
Local time
Yesterday, 22:39
Joined
Dec 13, 2013
Messages
21
I have a little problem and have these as I have sent a mail with this code, and a new mail sent word after I've filtered by productid he still the old mail sent how do I fix it
Code:
[/SIZE][/FONT]
 [FONT=Calibri][SIZE=3]Private Sub Mail_Click()
Dim Email As String, FileName As String, Filepath As String
Dim strSQL As String
Dim rs As Recordset
Dim qTmp As QueryDef
''Dim tmp As String
Dim folder As String
Me.Dirty = False[/SIZE][/FONT]
 [FONT=Calibri][SIZE=3] On Error GoTo Err_knop967_click
 [/SIZE][/FONT]
 [FONT=Calibri][SIZE=3]    
    strSQL = "SELECT * FROM QryPlanningmail WHERE [projectid] = " & Me.CboProjectNR & " Order by Email"
    Set qTmp = CurrentDb.QueryDefs("TmpPlanning")
        qTmp.SQL = strSQL
        
    ''tmp = InputBox("", "", strSQL)
    
     strSQL = "SELECT * FROM TmpPlanning WHERE ([Email] Is Not Null And Not [Email] = """")"
    Set rs = CurrentDb.OpenRecordset(strSQL)
    If rs.RecordCount > 0 Then
       Do Until rs.EOF
            If Not Email = vbNullString Then Email = Email & ";"
            Email = Email & rs!Email
            rs.MoveNext
        Loop
    Else
        MsgBox "Geen email adressen..."
        Exit Sub
   End If
   
    
    
 Me.ProjectID.Requery[/SIZE][/FONT]
 [FONT=Calibri][SIZE=3]folder = CurrentProject.Path & "\verzondenmail\"
DoCmd.OutputTo acOutputReport, "RptPlanning", acFormatPDF, folder & Me!ProjectID & ".pdf"[/SIZE][/FONT]
 [FONT=Calibri][SIZE=3]DoCmd.OpenReport "RpTPlanning", acViewPreview, , Me.Filter, acHidden
DoCmd.SendObject acSendReport, "RptPlanning", acFormatPDF, Email, , , "Planning", True[/SIZE][/FONT]
 [FONT=Calibri][SIZE=3][/SIZE][/FONT] 
 [FONT=Calibri][SIZE=3][/SIZE][/FONT] 
[FONT=Calibri][SIZE=3] 
DoCmd.Close acReport, "RptPlanning"
Err_mail_click:
    MsgBox Err.Description
    
  If Len(Verzonden) = 0 Then
Verzonden.Value = False
Else
Verzonden.Value = True
 
 End If
    
Err_knop967_click:
    MsgBox Err.Description
 End Sub
 
Not sure I understand... Is it going to the old eMail Address or is he getting the old Report?
 
Not sure I understand... Is it going to the old eMail Address or is he getting the old Report?

Both
he send the same email and Report
 
I have double-checked but he does this only when sending and making the report so email addresses are displayed correctly.
 
If you are saying the report is the same and it shouldn't be then the report needs to be moved inside the loop.

Question... Who is he?
 
where i put the DoCmd.OpenReport "RpTPlanning", acViewPreview, , Me.Filter, acHidden
DoCmd.SendObject acSendReport, "RptPlanning", acFormatPDF, Email, , , "Planning", True

in the loop ???
Can you help me with rewrite the code?

 
Well, before anything can be done... what part of this does work? Like... does it create separate reports? Does it create separate eMails? Do any reports go out eMail?
 
working Email not working make report
 
dino,

You are not providing enough information for people to help. If English is not your native language, then write your description in simple terms telling readers what exactly is the problem. "Not working" is not helpful. What exactly are the symptoms? What is he required output? What is the actual output?..
Write the description in your own language and translate with Google.
U bent niet verstrekken genoeg informatie voor mensen om te helpen. Als Engels niet je moedertaal, dan schrijf uw beschrijving in eenvoudige bewoordingen vertellen lezers wat precies het probleem is. "Niet werken" is niet nuttig. Wat zijn de symptomen? Wat is hij verplicht output? Wat is de werkelijke output? ..


Schrijf de beschrijving in uw eigen taal en vertalen met Google.
 
Okay then I write in my own words and use the google option is not for translation. The problem is that the create mail works perfectly if I make a new search ID, then the new Email created perfect data but not the document that is still the same. I do it one more time refresh then everything should be fine. Have already tried with command Refresh but that doesn't help either.
 

Users who are viewing this thread

Back
Top Bottom