Hi All,
I am trying to open the report conditionally from the dialogue box
form. In the form there are three field.
cboEmployees
StartDate
EndDate
I have used these field in criteria to open the report. If I use the
field name and between command, the report is not opening but when I
use the greater than and less than equal to, the report is opening but
there is no records. The used code are as follows:
Private Sub cmdPrint_Click( )
Dim strSelectEmp As String
'strSelectEmp = "[EmpName] = '" & Me.cboEmployees & "' AND
(datevalue([OverTimeDate]) Between '" & DateValue(Me.St artDate) And
DateValue(Me.En dDate) & "')"
strSelectEmp = "[EmpName] = '" & Me.cboEmployees & "' and
(datevalue([overtimedate]) >= '" & DateValue(Me.St artDate) & "' and
datevalue([overtimedate]) <= '" & DateValue(Me.En dDate) & "')"
DoCmd.OpenRepor t "rptOverTimeApp roval", acViewPreview, ,
strSelectEmp
End Sub
Can anybody help me to solve the problem.
Thanks in advance
Naushad
I am trying to open the report conditionally from the dialogue box
form. In the form there are three field.
cboEmployees
StartDate
EndDate
I have used these field in criteria to open the report. If I use the
field name and between command, the report is not opening but when I
use the greater than and less than equal to, the report is opening but
there is no records. The used code are as follows:
Private Sub cmdPrint_Click( )
Dim strSelectEmp As String
'strSelectEmp = "[EmpName] = '" & Me.cboEmployees & "' AND
(datevalue([OverTimeDate]) Between '" & DateValue(Me.St artDate) And
DateValue(Me.En dDate) & "')"
strSelectEmp = "[EmpName] = '" & Me.cboEmployees & "' and
(datevalue([overtimedate]) >= '" & DateValue(Me.St artDate) & "' and
datevalue([overtimedate]) <= '" & DateValue(Me.En dDate) & "')"
DoCmd.OpenRepor t "rptOverTimeApp roval", acViewPreview, ,
strSelectEmp
End Sub
Can anybody help me to solve the problem.
Thanks in advance
Naushad
Comment