use this code in your search button.
Option Compare Database
'Option Explicit << remove this
Private Sub Search_Button_Click()
Dim strFilter As String
Dim strDateStart As String
Dim strDateEnd As String
If IsNull(Forms![test].FromDate) Or Forms![test].ToDate = "" Then
MsgBox "Start...