Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940

    Why can't you just upload here? is the site preventing you due to low number of posts?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  2. #17
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    I have downloaded it anyway and it opens to a single record in the report.
    I do not know what is going on with the email outlook part as it falls over on the .To line, yet if I put objMail.To = in the IM window it accepts it, that and subject and body?
    Not something I have seen before. :-(

    You also need to lean to compile your code, before trying to run it?

    THis is failing on compile, not how you filter.

    Code:
    Private Sub Report_Filter(Cancel As Integer, FilterType As Integer)
    
    
    '"[ControleID]=" & [Formulieren]![ControleArchief]![ControleID]
    
    
    End Sub
    I put the ' in front of the code so I could compile.
    I use
    Code:
    Me.filter = "[ControleID]=" & [Formulieren]![ControleArchief]![ControleID]
    Me.filteron = True
    for forms or reports
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #18
    xps35's Avatar
    xps35 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    232
    Sorry for the non-Dutch readers. I must write this one in Dutch because it is getting to complicated for me in English

    Hallo Richard,

    Dat je code niets doet en ook geen fouten oplevert is niet zo vreemd. Je hebt de code om de bijlages toe te voegen verwijderd en vervangen door debug.prints. De bedoeling was dat je de debug.prints zou toevoegen zodat je kon zien welk pad en welke bestandsnaam gebruikt werden.
    Een ander probleem is dat de bestanden die je wilt verzenden helemaal niet aangemaakt worden. Je opent alleen een preview van een rapport, maar slaat niets op.

    Ik heb zelf ook zoiets aan de hand. Ik ben secretaris van een sportvereniging en doe de ledenadministratie in een Accessdatabase. In het kader van de AVG moeten we de leden kunnen laten zien welke gegevens we van ze geregistreerd hebben. Op het formulier met de ledengegevens heb ik daarom een knop gemaakt om een rapport in pdf-formaat naar het betreffende lid te mailen. De manier waarop ik dat doe heb ik wat omgebouwd en in jouw database gezet.
    De truc is dat je op het rapport een knop zet die het mailen verzorgt. Ik heb daartoe een knop aan "Rapport" toegevoegd. Op het formulier ControleArchief staat nu nog maar één knop. Die opent het rapportvoorbeeld. Desgewenst kan je op de knop op het rapport drukken en wordt er een mail met bijlage geopend (nog niet verzonden). De knop is op het uiteindelijke rapport overigens niet zichtbaar.

    Deze oplossing werkt niet als je twee verschillende rapporten wilt verzenden, maar ik heb nog niet ontdekt wat het tweede is.

    De gegevens kwamen me bekend voor. Heb je ook weleens een vraag gesteld op Helpmij.nl?
    Last edited by xps35; 10-24-2023 at 02:38 AM.
    Groeten,

    Peter

  4. #19
    xps35's Avatar
    xps35 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    232
    En dan ook de database...............
    Attached Files Attached Files
    Groeten,

    Peter

  5. #20
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Well as long as you sort his issue?
    I was stumped with the With ObjMail?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #21
    xps35's Avatar
    xps35 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    232
    Google Translate helped me.

    It is not surprising that your code does nothing and does not produce any errors. You have removed the code to add the attachments and replaced it with debug.prints. The idea was that you would add the debug.prints so that you could see which path and filename were used.
    Another problem is that the files you want to send are not created at all. You only open a preview of a report, but don't save anything.

    I have something similar going on myself. I am secretary of a sports club and do the membership administration in an Access database. In the context of the GDPR, we must be able to show members what data we have registered about them. I have therefore created a button on the form with the member details to email a report in PDF format to the member in question. I have slightly modified the way I do this and put it in your database.
    The trick is to put a button on the report that takes care of the emailing. I have added a button to "Rapport" for this purpose. There is now only one button on the ControleArchief form. This opens the report preview. If desired, you can press the button on the report and an email with an attachment will open (not yet sent). The button is not visible on the final report.

    This solution doesn't work if you want to send two different reports, but I haven't figured out what the second one is yet.

    The data looked familiar to me. Have you ever asked a question on Helpmij.nl?
    Groeten,

    Peter

  7. #22
    Bunic000 is offline Novice
    Windows 10 Office 365
    Join Date
    Oct 2023
    Posts
    8
    Good morning everyone, thank you for your input and thoughts. I have enough information to figure out the next steps.......to be continued

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Send report by mail fails after update
    By pommeke in forum Reports
    Replies: 2
    Last Post: 12-23-2017, 07:41 AM
  2. Send automatic e-mail
    By Csalge in forum Forms
    Replies: 1
    Last Post: 04-08-2013, 11:33 AM
  3. Replies: 1
    Last Post: 09-14-2012, 10:27 AM
  4. Send e-mail with info from Report
    By mari_hitz in forum Import/Export Data
    Replies: 22
    Last Post: 12-17-2011, 06:24 PM
  5. Replies: 4
    Last Post: 04-13-2011, 10:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums