G
Guest
Okay I got this off the internet and followed all the directions, it opens my
report but displays all the dates not specific days. Please Help.....
Private Sub Command4_Click()
Dim strReport As String
Dim strField As String
Dim strWhere As String
Const conDateFormat = "\#mm\/dd\/yyyy\#"
strReport = "DailyDispatch"
strField = "TOOnScene"
If IsNull(Me.txtstartdate) Then
If Not IsNull(Me.txtEndDate) Then
strWhere = strField & " < " & Format(Me.txtEndDate, conDateFormat)
End If
Else
If IsNull(Me.txtEndDate) Then
strWhere = strField & " > " & Format(Me.txtstartdate,
conDateFormat)
Else
strWhere = strField & " Between " & Format(Me.txtstartdate,
conDateFormat) _
& " And " & Format(Me.txtEndDate, conDateFormat)
End If
End If
DoCmd.OpenReport strReport, acViewPreview, , strWhere
End Sub
Private Sub Command5_Click()
DoCmd.Close acForm, Me.Name
End Sub
report but displays all the dates not specific days. Please Help.....
Private Sub Command4_Click()
Dim strReport As String
Dim strField As String
Dim strWhere As String
Const conDateFormat = "\#mm\/dd\/yyyy\#"
strReport = "DailyDispatch"
strField = "TOOnScene"
If IsNull(Me.txtstartdate) Then
If Not IsNull(Me.txtEndDate) Then
strWhere = strField & " < " & Format(Me.txtEndDate, conDateFormat)
End If
Else
If IsNull(Me.txtEndDate) Then
strWhere = strField & " > " & Format(Me.txtstartdate,
conDateFormat)
Else
strWhere = strField & " Between " & Format(Me.txtstartdate,
conDateFormat) _
& " And " & Format(Me.txtEndDate, conDateFormat)
End If
End If
DoCmd.OpenReport strReport, acViewPreview, , strWhere
End Sub
Private Sub Command5_Click()
DoCmd.Close acForm, Me.Name
End Sub