Opening Report via Parameter

mercredi 11 mars 2015

So I have a report that opens via Parameter. The SQL behind the query that runs the report is (I took out alot of lines that aren't necessary to answer the question)



PARAMETERS [Enter Your Box Id] Short;

SELECT DocumentsTable.OrganizationalID,

.

.

.

DocumentsTable.Status

FROM DepartmentsTable INNER JOIN (Year1 INNER JOIN DocumentsTable ON Year1.ID = DocumentsTable.RecordDateYearID) ON DepartmentsTable.ID = DocumentsTable.DepartmentID

WHERE (((DocumentsTable.Voided)<>'Y' Or (DocumentsTable.Voided) Is Null) AND ((DocumentsTable.ID)=[Enter Your Box ID]));







So if I click on the report, I get a little popup that says "Enter Your Box ID", and when I do, the report works just as expected.



However, I also want to be able to open this report via link from another report, and pass the Box ID #. I just can't get the syntax right. I would have thought it was this:





Private Sub ID_Click()

DoCmd.OpenReport "Find A Box", acViewReport, , "[Enter Your Box Id]=" & Me.ID

End Sub





However when that execute, I still get the pop up asking for "Enter Your Box ID"

Opening Report via Parameter

0 commentaires:

Enregistrer un commentaire

Labels