M
mrvertrix
Guest
I have a Visual Basic 6 App that opens an access opbject and prints a predefined report :-
Set acApp = GetObject(SAMPLE_DB_PATH, "Access.Application")
acApp.Visible = True
With acApp.DoCmd
.OpenReport "CustomerOrders, acViewNormal
This works fine. But when i try to specify a where clause :-
.OpenReport strReportName, acViewNormal, , "CustomerXOrder.CollectionDate = '24/12/2005'"
I get a prompt from Access asking for a value of CustomerXOrder.CollectionDate.
The SQL where clause is properly structured, as i have inserted it into the SQL statement of the report to generate the right results.
Can someone please tell me how to pass the where clause to the report without the prompt requesting the value i am trying to pass.
many thanks in advance
Set acApp = GetObject(SAMPLE_DB_PATH, "Access.Application")
acApp.Visible = True
With acApp.DoCmd
.OpenReport "CustomerOrders, acViewNormal
This works fine. But when i try to specify a where clause :-
.OpenReport strReportName, acViewNormal, , "CustomerXOrder.CollectionDate = '24/12/2005'"
I get a prompt from Access asking for a value of CustomerXOrder.CollectionDate.
The SQL where clause is properly structured, as i have inserted it into the SQL statement of the report to generate the right results.
Can someone please tell me how to pass the where clause to the report without the prompt requesting the value i am trying to pass.
many thanks in advance