Passing parameter to report through VB

  • Thread starter Thread starter John Legourdas
  • Start date Start date
J

John Legourdas

I have an access 2000 database with reports. These reports
use a query to get their data. The query uses parameters
for the start and end dates

I have a VB 6 front end which runs and using a timer will
execute certain reports automatically on a 30 minute
interval. These reports are then saved as HTML so that
users can view their statistics from a web page link Ive
set up. It all works nicely except that for the life of me
I cannot figure out how to pass the start and end date to
the REPORT. I know how to pass this to the query, but this
does not help me.

Any help would be appreciated.

Thanks

John
 
Have you tried using the Where clause in the DoCmd.OpenReport method?

Otherwise consider a table in the database with a single record and fields
for dateStart and dateEnd. You can set these values from VB6 and then use
them in your query to filter your report's record source.
 
I am actually not using the DoCmd.OpenReport method.
Intead I am using the DoCmd.OutputTo method because I dont want the report
to come up on screen, just to dump to an html file silently. If Im not
mistaken the OutputTo method does not have the Where clause

Your other suggestion about a table to hold the dates is actually an
interesting workaround that should do the trick (simple but effective).
However, at the same time I would love to figure out how to do it strictly
through the VB front end by passing the values

Thanks

John
 
Back
Top