Comboboxes and reports

MikeLeBen

Still struggling
Local time
Today, 23:22
Joined
Feb 10, 2011
Messages
187
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:
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.
 
The traditonal way of doing this is putting the dates on a form where the User can type them in (or use a calendar control) and once the dates are selected the report will open. Is there a reason you don't want to do it that way?
 
I'm just starting out with reports, and seeing I could use the standard controls as with the forms I thought I could spare the user the step of the form and give them a little more "dynamic" of a report;
it's actually due to my lack of experience with them, I guess I will go with the way you pointed out.
 
I'm just starting out with reports, and seeing I could use the standard controls as with the forms I thought I could spare the user the step of the form and give them a little more "dynamic" of a report;
it's actually due to my lack of experience with them, I guess I will go with the way you pointed out.

Reports are not interactive, they are just a static display of data. I'm not sure why MS even made combo boxes and command buttons available for reports. You can place either of these controls on a report but they are utterly useless because there is no way interact with them. They're only usable on forms.
 

Users who are viewing this thread

Back
Top Bottom