View Single Post
  #5 (permalink)  
Old February 8th, 2018, 10:21 AM is offline
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Feb 2018
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default pass throuh query with parameter in report

14 years later ...
I just looked for information on passing parameters to pass throuh query. after much research I found this excellent article.
I bring my contribution on the part concerning the passing parameters to a report. In fact the trick is to dynamically change the query before launching the report. the code presented contains many useless things, I allow myself to present the following code for the part:
   Private Sub Report_Open
   'it is enough to write:
   Dim qdf As QueryDef
         Set qdf = currentdb.QueryDefs ("TArrivalsByRegion")
   qdf.SQL = "EXEC TArrivalsByRegion" & Forms! DateRangePreviousCurrentYear! PrevYear & "," & Forms! DateRangePreviousCurrentYear! CurrYear
the rest of the article is ok for me
my english is not operational, I hope that the translator gives a good translation
Reply With Quote