HI. I use the following code to open a report from frmMain.
stDocName = "rptShowExpenses"
DoCmd.OpenReport stDocName, acViewPreview, "[DetID]= " & Me.DetID
DetID is a primary key in tblDetail which is a base of frmMain.
But, whatever DetID I choose in frmMain, the report only opens with one DetID.
In SQL code in the report, there is no WHERE clause because DetID is parsed from frmMain.
What is wrong?
Thanks for your comments in advance.
John
stDocName = "rptShowExpenses"
DoCmd.OpenReport stDocName, acViewPreview, "[DetID]= " & Me.DetID
DetID is a primary key in tblDetail which is a base of frmMain.
But, whatever DetID I choose in frmMain, the report only opens with one DetID.
In SQL code in the report, there is no WHERE clause because DetID is parsed from frmMain.
What is wrong?
Thanks for your comments in advance.
John