I needed my report to only show the records retrieved by a specific query, so I used the following code in the Report_Open event:
Unfortunately, though, this way the dates are arbitrary whereas I'd like the user to be able to choose the time range by using two comboboxes (i.e.: "get records from [cbobox_date1] to [cbobox_date2]").
No matter what I do, when I create comboboxes in the report, they don't show up (only the label does, and the blinking vertical bar too, as if they were there) and are therefore unusable.
P.S.: I also put a logo in the report but it doesn't show when I print the report on paper.
Code:
Me.Report.RecordSource = "SELECT Clienti.CognomeContatto, Clienti.NomeContatto, " & _
"Clienti_Ricette.MeseRicetta, Clienti_Ricette.AnnoRicetta, " & _
"Clienti_Ricette.ValoreRicetta, Clienti_Ricette.DataInserimento, " & _
"Clienti_Ricette.IDCliente " & _
"FROM Clienti INNER JOIN Clienti_Ricette " & _
"ON Clienti.IDCliente = Clienti_Ricette.IDCliente " & _
" WHERE DataDecorrenza BETWEEN " & Format(DateSerial(Year(Date), _
Month(Date) - 1, 1), "\#mm\/dd\/yyyy\#") & " AND " & Format(DateSerial _
(Year(Date), Month(Date), 1), "\#mm\/dd\/yyyy\#")
Unfortunately, though, this way the dates are arbitrary whereas I'd like the user to be able to choose the time range by using two comboboxes (i.e.: "get records from [cbobox_date1] to [cbobox_date2]").
No matter what I do, when I create comboboxes in the report, they don't show up (only the label does, and the blinking vertical bar too, as if they were there) and are therefore unusable.
P.S.: I also put a logo in the report but it doesn't show when I print the report on paper.