Technyc2003
IS-IT--Management
I've got a preview report button on my form that runs a query that asks me to Enter a Start and End Date, however, I'd also like it to ask me to enter a Team Number but I don't know how to write the code in my code below.
Private Sub PreviewRpt_Click()
Dim strWhere As String
strWhere = "1 = 1 "
If Not IsNull(Me.txtStartDate) Then
strWhere = strWhere & " And [PsychoSocialDate] >=#" & _
Me.txtStartDate & "# "
End If
If Not IsNull(Me.txtEndDate) Then
strWhere = strWhere & " And [PsychoSocialDate] <#" & _
Me.txtEndDate & "# "
End If
'other controls
DoCmd.OpenReport "rptPsychoServDates", acViewPreview, , strWhere
End Sub
Private Sub PreviewRpt_Click()
Dim strWhere As String
strWhere = "1 = 1 "
If Not IsNull(Me.txtStartDate) Then
strWhere = strWhere & " And [PsychoSocialDate] >=#" & _
Me.txtStartDate & "# "
End If
If Not IsNull(Me.txtEndDate) Then
strWhere = strWhere & " And [PsychoSocialDate] <#" & _
Me.txtEndDate & "# "
End If
'other controls
DoCmd.OpenReport "rptPsychoServDates", acViewPreview, , strWhere
End Sub