Hi:)I have a question.I am starting to develop a database in MS Access. I'm almost done.My question is the following.
Is it possible that a new report is automatically generated in PDF when a new entry is added for the current month
I will try show what I mean by help of pictures.
I have this menu
Here I have to invoice
When I press "Generer Faktura" = Generate Invoice
Comes all the invoices in the same generation.



What I would like the code to do is if I highlight the date 01-04-2021 and press the button generate invoice it is only for this month of invoice which is included
I have this code I am working on
On Error GoTo Err_Handler
Const FOLDER_EXISTS = 75
Const MESSAGE_TEXT_1 = "No folder set for storing PDF files."
Const MESSAGE_TEXT_2 = "No invoice(s) selected."
Dim strFullPath As String
Dim varFolder As Variant
Dim varFolder_1 As Variant
Dim varItem As Variant
' build path to save PDF file
varFolder = DLookup("Folderpath", "pdfFolder")
If IsNull(varFolder) Then
MsgBox MESSAGE_TEXT_1, vbExclamation, "Invalid Operation"
Else
With Me.lstInvoices
If .ItemsSelected.Count > 0 Then
For Each varItem In .ItemsSelected
Me.txtFaktura = .ItemData(varItem)
' create folder if does not exist
varFolder_1 = varFolder & "" & .Column(1, varItem)
MkDir varFolder_1
strFullPath = varFolder_1 & "" & .Column(1, varItem) & " " & .ItemData(varItem) & ".pdf"
DoCmd.OutputTo acOutputReport, "Faktura", acFormatPDF, strFullPath, True
Next varItem
Else
MsgBox MESSAGE_TEXT_2, vbExclamation, "Invalid Operation"
End If
End With
End If
Exit_Here:
Exit Sub
Err_Handler:
Select Case Err.Number
Case FOLDER_EXISTS
Resume Next
Case Else
MsgBox Err.Description
Resume Exit_Here
End Select