Why can't you just upload here? is the site preventing you due to low number of posts?
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
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.
I put the ' in front of the code so I could compile.Code:Private Sub Report_Filter(Cancel As Integer, FilterType As Integer) '"[ControleID]=" & [Formulieren]![ControleArchief]![ControleID] End Sub
I use
for forms or reportsCode:Me.filter = "[ControleID]=" & [Formulieren]![ControleArchief]![ControleID] Me.filteron = True
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
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
En dan ook de database...............
Groeten,
Peter
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
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
Good morning everyone, thank you for your input and thoughts. I have enough information to figure out the next steps.......to be continued