Hi i have a big problem using a Query Parameter to open and populate a report.
This is the Parameter Query:
PARAMETERS D1 DateTime, D2 DateTime;
SELECT tblResidents.NomResident, tblResidents.PrenomResident, tblPaiements.Paiement
FROM tblResidents INNER JOIN tblPaiements ON tblResidents.NoResident = tblPaiements.NoResident
WHERE (((tblPaiements.DateDuPaiement) Between D1 And D2))
ORDER BY tblResidents.NomResident, tblPaiements.DateDuPaiement;
(It's in french but to give you the idea is that i want all the payments of the tenants from the 1 day of the month until the last day of the month. It's D1 and D2. If a run the query in QBE it's working.
The report is simple i set the recordsource to the name and there is only the tenantLastname, thenantfirstname and payments sort by TenantsLastName.
I Have this form from which I send the parameters to the report, I check the box which is the month i want my report.
I tried first with the DoCmd.SetParameter:
DoCmd.SetParameter "D1", #1/1/2018#
DoCmd.SetParameter "D2", #1/31/2018#
DoCmd.OpenReport "Etat", acViewLayout
This generate a empty report.
I also tried with the where clause of the doCmd.OpenReport
param1 = #1/1/2018#
param2 = #1/31/2018#
DoCmd.OpenReport "Etat", acViewLayout, , "D1 = " & param1 & " And D2 = " & param2
This also generate a empty report. It should print 7 records in january
Thanks
This is the Parameter Query:
PARAMETERS D1 DateTime, D2 DateTime;
SELECT tblResidents.NomResident, tblResidents.PrenomResident, tblPaiements.Paiement
FROM tblResidents INNER JOIN tblPaiements ON tblResidents.NoResident = tblPaiements.NoResident
WHERE (((tblPaiements.DateDuPaiement) Between D1 And D2))
ORDER BY tblResidents.NomResident, tblPaiements.DateDuPaiement;
(It's in french but to give you the idea is that i want all the payments of the tenants from the 1 day of the month until the last day of the month. It's D1 and D2. If a run the query in QBE it's working.
The report is simple i set the recordsource to the name and there is only the tenantLastname, thenantfirstname and payments sort by TenantsLastName.
I Have this form from which I send the parameters to the report, I check the box which is the month i want my report.
I tried first with the DoCmd.SetParameter:
DoCmd.SetParameter "D1", #1/1/2018#
DoCmd.SetParameter "D2", #1/31/2018#
DoCmd.OpenReport "Etat", acViewLayout
This generate a empty report.
I also tried with the where clause of the doCmd.OpenReport
param1 = #1/1/2018#
param2 = #1/31/2018#
DoCmd.OpenReport "Etat", acViewLayout, , "D1 = " & param1 & " And D2 = " & param2
This also generate a empty report. It should print 7 records in january
Thanks