
|
Problem with data report generation
I am running a parameterized query in the Data Environment Designer (comes with Enterprise Edition Visual Studio) in order to generate a Data Report. When I initialize the recordset out of the Data Environment's command object, the code works only in debug mode. As soon as I run it, I get this error:
Parameter_1 does not contain a value.
When I step through the code, it runs perfectly. I tried putting a loop just to wait for some 2 seconds before the report generation but it did me no good.
Help.
Here's the code:
----------------------------------------------------
Private Sub cmdOrder_Click()
Dim LngTime As Long
Call de.EmployeeAttendanceHistory(cboEmployeeName.ItemData(cboEmployeeName.ListIndex), _
CDate(dtStartDate.Value), CDate(dtEndDate.Value))
With rptEmployeeAttendanceHistory
.Sections("Section2").Controls("lblEmployeeName").Caption = cboEmployeeName.Text
.Sections("Section2").Controls("lblPeriod").Caption = "From " & _
FormatDateTime(dtStartDate.Value, vbLongDate) & " and " & _
FormatDateTime(dtEndDate.Value, vbLongDate)
LngTime = Timer
Do
Debug.Print "Useless code just to wait."
Loop Until LngTime + 5 < Timer
.Show
Call de.rsEmployeeAttendanceHistory.Close
End With
Unload Me
End Sub
----------------------------------------------------
And here's the meat in the command object:
----------------------------------------------------
SELECT Attendance.`Employee ID`, Employee.`Employee Name`, Attendance.`LogIn Date`, Attendance.`Login Time`, Attendance.`LogOut Date`, Attendance.`LogOut Time` FROM Attendance, Employee WHERE Attendance.`Employee ID` = Employee.`Employee ID` AND (Attendance.`Employee ID` = ?) AND (Attendance.`Login Date` >= ?) AND (Attendance.`LogOut Date` <= ?) ORDER BY (Attendance.`Login Date`)
----------------------------------------------------
Sathyaish Chakravarthy
Monday, March 29, 2004
Sathyaish Chakravarthy ,
I would suggest the lovely people at:
http://peach.ease.lsoft.com/scripts/wa.exe?A0=visbas-l
may be likely to help.
Seeya
Tuesday, March 30, 2004
Thanks, Mathew. :)
Sathyaish Chakravarthy
Tuesday, March 30, 2004
Recent Topics
Fog Creek Home
|