I assume that you are automating Access to print your report? There are a couple of solutions. 1: You could just get Access to prompt for the paramaters. 2: Alter the query's SQL before printing the report.
It is possible to give a query paramaters from your VB program, but then, as far as I know, its only possible to open a recordset based on the query result. This wouldnt be available to your report.
Another idea would to have a table which contains values which can be used as criteria to the query. Then just before printing the report you update the values in the table.
>>terry Jeg har selv tænkt på, at lade Access hente værdierne i en tabel. Jeg har prøvet at lade Access prompte for parametrene, men jeg er ked af, at man ikke kan nøjes med at se den dialogboks, der fremkommer, i stedet for hele Access.
2: Alter the query's SQL before printing the report.
This example is how it is done directly in Access, its similar in VB and if you are automating Access then I think you will have an idea as how it needs to be modified
EXAMPLE: Dim sSQL As String
'Build the SQL in code. (You need a query named (in this example) qPRapport Data) sSQL = "SELECT [qPRapport Dato].Dato, .......[qPRapport 1a].Tilløbx AS [Tind 2003], ...."
'Now modify the queries SQL (query MUST exist already) CurrentDb.QueryDefs("qPRapport Data").SQL = sSQL
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.