Search boxes on a form

jenkinsearl35

New member
Local time
Today, 01:59
Joined
Sep 27, 2012
Messages
4
Hey everyone,

I have a small problem that I can't seem to figure out. I have a split form that I use as an overview of orders. I have a couple of unbound text boxes that I use to search with including one to enter a date. These boxes are working great. What I need to do is add an additional text box that I can enter another date in and the form will show me the orders in that date range. I have a code that works great with single text boxes. I was wondering if anyone knows how to modify it to include a second date box to search for those date ranges.

Here is the code that I have.

Private Sub datesearch_Change()
Dim strFilter As String
On Error GoTo ErrHandler
If Me.datesearch.Text <> "" Then
strFilter = "[ORDER_DATE] Like '*" & Me.datesearch.Text & "*'"
Me.Filter = strFilter
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
End If
With Me.datesearch
.SetFocus
.SelStart = Len(Me.datesearch.Text)
End With
Exit Sub
ErrHandler:
MsgBox Err.Description, vbExclamation
End Sub


Thanks in advance.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom