asked on
ASKER
ASKER
Private Sub cmdApplyFilter_Click()
Dim strFirstName As String
Dim strLastName As String
Dim strFilter As String
' Build First Name criteria string
If IsNull(Me.txtFirstName.Value) Then
strFirstName = "Like '*'"
Else
Select Case Me.fraFirstName.Value
Case 1
strFirstName = "Like '" & Me.txtFirstName.Value & "*'"
Case 2
strFirstName = "Like '*" & Me.txtFirstName.Value & "*'"
Case 3
strFirstName = "Like '*" & Me.txtFirstName.Value & "'"
Case 4
strFirstName = "= '" & Me.txtFirstName.Value & "'"
End Select
End If
' Build Last Name criteria string
If IsNull(Me.txtLastName.Value) Then
strLastName = "Like '*'"
Else
Select Case Me.fraLastName.Value
Case 1
strLastName = "Like '" & Me.txtLastName.Value & "*'"
Case 2
strLastName = "Like '*" & Me.txtLastName.Value & "*'"
Case 3
strLastName = "Like '*" & Me.txtLastName.Value & "'"
Case 4
strLastName = "= '" & Me.txtLastName.Value & "'"
End Select
End If
' Build filter string
strFilter = "[FirstName] " & strFirstName & _
" AND [LastName] " & strLastName
' Apply filter to form
Me.frm.Form.Filter = strFilter
Me.frm.Form.FilterOn = True
End Sub
ASKER
ASKER
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
can you post just the code from your double click event?