Hi, I created the following function on a button.
Private Sub Search_Click()
If (IsNull(cboType)) Or (IsNull(txtCriteria)) Then
MsgBox "Please select search type", vbOKOnly, "Please select search type"
ElseIf [cboType] = "Last Name" And [txtCriteria] > "" Then
DoCmd.OpenForm "frmSearchLastName"
ElseIf [cboType] = "First Name" And [txtCriteria] > "" Then
DoCmd.OpenForm "frmSearchFirstName"
ElseIf [cboType] = "Call Date" And [txtCriteria] > "" Then
DoCmd.OpenForm "frmSearchDate"
End If
End Sub
And I have forms that point to a query and pick up the txtCriteria that I typed and return me the list of match result.
My questions is how can I create a date range search when cBoType is "Call Date" and click on Search Button, prompt me to enter date range?
And on my query, I am using...
Like [Forms]![frmSearch].[txtCriteria] & "*
Private Sub Search_Click()
If (IsNull(cboType)) Or (IsNull(txtCriteria)) Then
MsgBox "Please select search type", vbOKOnly, "Please select search type"
ElseIf [cboType] = "Last Name" And [txtCriteria] > "" Then
DoCmd.OpenForm "frmSearchLastName"
ElseIf [cboType] = "First Name" And [txtCriteria] > "" Then
DoCmd.OpenForm "frmSearchFirstName"
ElseIf [cboType] = "Call Date" And [txtCriteria] > "" Then
DoCmd.OpenForm "frmSearchDate"
End If
End Sub
And I have forms that point to a query and pick up the txtCriteria that I typed and return me the list of match result.
My questions is how can I create a date range search when cBoType is "Call Date" and click on Search Button, prompt me to enter date range?
And on my query, I am using...
Like [Forms]![frmSearch].[txtCriteria] & "*