hi Arnel,
nice to see you here.
Its nice to see all the messages in a thread, but the default for many is not to include previous messages. Duane uploaded an image showing what you need to select:
https://groups.io/g/MSAccessProfessionals/photofromactivity?id=2977001
kind regards,
crystal
On 7/18/2020 11:12 PM, Arnelito Puzon wrote:
if it is a SubReport we are talking, you can still filter the subreport using the Parent Report's OpenArgs.
the OP needs to Copy/Paste the Original pass-through query to another pt query name(ex: zzRptQuery1)
on the Open Event of the Subform:
Private Sub Report_Open(Cancel As Integer)Const ALTERNATIVE_SOURCE As String = "zzRptQuery1"Dim strWhere As StringDim strSQL As StringDim qd As DAO.QueryDefDim db As DAO.DatabasestrWhere = Nz(Reports!TableReport.OpenArgs, "")If Len(strWhere) > 0 ThenSet db = CurrentDbstrSQL = db.QueryDefs("theOriginalPassThroughQueryNameHere").SQLstrSQL = Replace(strSQL, ";", "")strSQL = strSQL & " WHERE " & strWhere'On Error Resume Next'DoCmd.DeleteObject acQuery, ALTERNATIVE_SOURCE'Set qd = db.CreateQueryDef(ALTERNATIVE_SOURCE, strSQL)'db.QueryDefs.Append qdSet qd = db.QueryDefs(ALTERNATIVE_SOURCE)qd.SQL = strSQLSet qd = NothingSet db = NothingMe.RecordSource = ALTERNATIVE_SOURCEEnd IfEnd Sub
--
Arnelito G. Puzon
Tidak ada komentar:
Posting Komentar