G
Guest
I'm trying to use an Inputbox to search for a Date.
Function SearchOrderList_Date()
Dim strSearch As String
'------------------------------------------------------------
'Set the input Box
'------------------------------------------------------------
strSearch = InputBox("What is the Date (mm/dd/yy)?", " Order List by
Date")
If strSearch = Null Then
Exit Function
Else
'------------------------------------------------------------
'This will close the from
'------------------------------------------------------------
CloseForm
'------------------------------------------------------------
'Open Form and Filter
'------------------------------------------------------------
stDocName = "frmOrderList"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.ApplyFilter "Find", "([qryListOrder]![DATEORD] = " & strSearch
& ")"
'------------------------------------------------------------
'Maximize
'------------------------------------------------------------
DoCmd.Maximize
End If
Exit_cmdOpenForm_Click:
Exit Function
Err_cmdOpenForm_Click:
MsgBox Err.Description
Resume Exit_cmdOpenForm_Click
End Function
Function SearchOrderList_Date()
Dim strSearch As String
'------------------------------------------------------------
'Set the input Box
'------------------------------------------------------------
strSearch = InputBox("What is the Date (mm/dd/yy)?", " Order List by
Date")
If strSearch = Null Then
Exit Function
Else
'------------------------------------------------------------
'This will close the from
'------------------------------------------------------------
CloseForm
'------------------------------------------------------------
'Open Form and Filter
'------------------------------------------------------------
stDocName = "frmOrderList"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.ApplyFilter "Find", "([qryListOrder]![DATEORD] = " & strSearch
& ")"
'------------------------------------------------------------
'Maximize
'------------------------------------------------------------
DoCmd.Maximize
End If
Exit_cmdOpenForm_Click:
Exit Function
Err_cmdOpenForm_Click:
MsgBox Err.Description
Resume Exit_cmdOpenForm_Click
End Function