
crystal 7.0 VB6 and Access97
Hi,
I have been having a heck of a time trying to send date parameters to a
Crystal Report7.0 from VB6 and an Access97 database on the local machine
only, not on a network.
I am using two different calander controls to send the dates to text boxes.
This allows the user to pick their dates for the report.
The problem is that I don't know what property to use in code so the report
can pick up the two dates. I have tried this code:
crReport.SQLQuery = "SELECT Table1.Date, Table1.Site From Table1 WHERE
(((Table1.Date) Between (txtDate1) And (txtDate2))ORDER BY Table1.Date;"
I get an error with this code that says unable to open SQL Server. I am not
on a network, is this why I get this error?
I have also tried this code:
crReport.SelectionFormula = "SELECT Table1.Date, Table1.Site From Table1
WHERE (((Table1.Date) Between (txtDate1) And (txtDate2))ORDER BY
Table1.Date;"
I get an error that says the remaining text does not appear to be part of
the formula. There is no other text besides the sql string.
I have built the report already and use crReport.ReportFileName =
"report1.rpt" property
How can I pass the parameters from the two text boxes to the previously
built report so the user can get only the information between the two dates
they desire.
This has been a real headache and any help is greatly appreciated.
Thanks,
Sandy
--
Sandy MacDonald