Humbermaniac Level: Guest

|
VB6 => Access2000, Passing 2 Parameters? Archived to Disk
Hi, I'm trying to print an access2000 Report from VB6, and need to pass 2 parameters - a start date and an end date. Here is my code (which doesn't work:
intResponse = MsgBox("Are you sure you want to print this Report?", vbYesNo, "Print Horticulture Income Report?" )
If intResponse = vbYes Then
DatabaseName = App.Path + "Millwood4.mdb"
AppAccess.OpenCurrentDatabase (DatabaseName)
AppAccess.DoCmd.OpenReport "repHortiIncome", acViewNormal, , _
"[Start]= " & dtpStart.Value & "AND [End]= " & dtpEnd.Value
AppAccess.CloseCurrentDatabase
Set AppAccess = Nothing
Screen.MousePointer = vbDefault
End If
T^hem 2 parameters (Start , End) are in the underlying query on which the Report is based.
Any help would be much appreciated....I know it must be close!
Thanks
|